﻿<!--
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Public License (Ms-PL).
// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
// All other rights reserved.
-->

<UserControl
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:toolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"
xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows"
  
  x:Class="System.Windows.Controls.Samples.ExpanderSample">
    <StackPanel>
        <StackPanel.Resources>
            <Style x:Key="DemoButton" TargetType="Button">
                <Setter Property="Margin" Value="2" />
                <Setter Property="Foreground" Value="Blue" />
                <Setter Property="Content" Value="Content From Style" />
            </Style>
            <Style x:Key="DemoExpander" TargetType="toolkit:Expander">
                <Setter Property="Header" Value="Header" />
                <Setter Property="Content" Value="Content" />
                <Setter Property="Margin" Value="5"/>
            </Style>
        </StackPanel.Resources>

        <!-- ExpandDirection table -->
        <ContentControl Content="ExpandDirection" Style="{StaticResource Header}" />
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="150" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="150" />
                <ColumnDefinition Width="150" />
                <ColumnDefinition Width="150" />
                <ColumnDefinition Width="150" />
            </Grid.ColumnDefinitions>
            
            <TextBlock Grid.Row="0" Grid.Column="0" Style="{StaticResource Description}" Text="ExpandDirection.Down"  FontWeight="Bold"/>
            <TextBlock Grid.Row="0" Grid.Column="1" Style="{StaticResource Description}" Text="ExpandDirection.Up" />
            <TextBlock Grid.Row="0" Grid.Column="2" Style="{StaticResource Description}" Text="ExpandDirection.Left"/>
            <TextBlock Grid.Row="0" Grid.Column="3" Style="{StaticResource Description}" Text="ExpandDirection.Right" />
            
            <toolkit:Expander Grid.Row="1" Grid.Column="0" ExpandDirection="Down" Style="{StaticResource DemoExpander}">
            </toolkit:Expander>
            <toolkit:Expander Grid.Row="1" Grid.Column="1" ExpandDirection="Up" Style="{StaticResource DemoExpander}">
                <toolkit:Expander.Content>
                    <Button Content="&lt;Button&gt;"></Button>
                </toolkit:Expander.Content>
            </toolkit:Expander>
            <toolkit:Expander Grid.Row="1" Grid.Column="2" ExpandDirection="Left" Style="{StaticResource DemoExpander}"
                               Header="&lt;HeaderTemplate&gt;">
                <toolkit:Expander.HeaderTemplate>
                    <DataTemplate>
                        <Button Content="{Binding}" Style="{StaticResource DemoButton}"></Button>
                    </DataTemplate>
                </toolkit:Expander.HeaderTemplate>
            </toolkit:Expander>
            <toolkit:Expander Grid.Row="1" Grid.Column="3" ExpandDirection="Right" Style="{StaticResource DemoExpander}"
                               Header="&lt;HeaderTemplate&gt;" Content="&lt;ContentTemplate&gt;">
                <toolkit:Expander.HeaderTemplate>
                    <DataTemplate>
                        <TextBlock Text="{Binding}" Foreground="Blue"/>
                    </DataTemplate>
                </toolkit:Expander.HeaderTemplate>
                <toolkit:Expander.ContentTemplate>
                    <DataTemplate>
                        <Button Content="{Binding}" Style="{StaticResource DemoButton}"></Button>
                    </DataTemplate>
                </toolkit:Expander.ContentTemplate>
            </toolkit:Expander>
        </Grid>

        <!-- Customization -->
        <ContentControl Content="Customization" Style="{StaticResource Header}" />
        <Grid>
            <Grid.Resources>
                <Style x:Key="ExpanderFadeStyle" TargetType="toolkit:Expander">
                    <Setter Property="Background" Value="Transparent"/>
                    <Setter Property="BorderBrush" Value="Transparent"/>
                    <Setter Property="BorderThickness" Value="1"/>
                    <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                    <Setter Property="VerticalContentAlignment" Value="Stretch"/>
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="toolkit:Expander">
                                <Grid Background="Transparent">
                                    <Grid.Resources>
                                        <LinearGradientBrush x:Key="ExpanderArrowFill" EndPoint="0,1" StartPoint="0,0">
                                            <GradientStop Color="White" Offset="0"/>
                                            <GradientStop Color="#FFBFBFBF" Offset="0.5"/>
                                            <GradientStop Color="#FF878787" Offset="1"/>
                                        </LinearGradientBrush>
                                        <LinearGradientBrush x:Key="ExpanderArrowHoverFill" EndPoint="0,1" StartPoint="0,0">
                                            <GradientStop Color="#FFF0F8FE" Offset="0"/>
                                            <GradientStop Color="#FFE0F3FE" Offset="0.3"/>
                                            <GradientStop Color="#FF6FA7C5" Offset="1"/>
                                        </LinearGradientBrush>
                                        <LinearGradientBrush x:Key="ExpanderArrowPressedFill" EndPoint="0,1" StartPoint="0,0">
                                            <GradientStop Color="#FFDCF0FA" Offset="0"/>
                                            <GradientStop Color="#FFC5E6F7" Offset="0.2"/>
                                            <GradientStop Color="#FF5690D0" Offset="1"/>
                                        </LinearGradientBrush>
                                        <ControlTemplate x:Key="ExpanderDownHeaderTemplate" TargetType="ToggleButton">
                                            <Grid Background="Transparent">
                                                <vsm:VisualStateManager.VisualStateGroups>
                                                    <vsm:VisualStateGroup x:Name="CheckStates">
                                                        <vsm:VisualStateGroup.Transitions>
                                                            <vsm:VisualTransition GeneratedDuration="00:00:00"/>
                                                        </vsm:VisualStateGroup.Transitions>
                                                        <vsm:VisualState x:Name="Checked">
                                                            <Storyboard>
                                                                <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="Data">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="M 1,4.5 L 4.5,1 L 8,4.5"/>
                                                                </ObjectAnimationUsingKeyFrames>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                        <vsm:VisualState x:Name="Unchecked"/>
                                                    </vsm:VisualStateGroup>
                                                    <vsm:VisualStateGroup x:Name="CommonStates">
                                                        <vsm:VisualStateGroup.Transitions>
                                                            <vsm:VisualTransition GeneratedDuration="0"/>
                                                            <vsm:VisualTransition GeneratedDuration="00:00:00.1" To="MouseOver"/>
                                                            <vsm:VisualTransition GeneratedDuration="00:00:00.1" To="Pressed"/>
                                                        </vsm:VisualStateGroup.Transitions>
                                                        <vsm:VisualState x:Name="Normal"/>
                                                        <vsm:VisualState x:Name="MouseOver">
                                                            <Storyboard>
                                                                <ColorAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Stroke).(SolidColorBrush.Color)" To="#FF3C7FB1"/>
                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Fill)">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderArrowHoverFill}"/>
                                                                </ObjectAnimationUsingKeyFrames>
                                                                <ColorAnimation BeginTime="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="(Path.Stroke).(SolidColorBrush.Color)" To="#222"/>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                        <vsm:VisualState x:Name="Pressed">
                                                            <Storyboard>
                                                                <ColorAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Stroke).(SolidColorBrush.Color)" To="#FF526C7B"/>
                                                                <DoubleAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="StrokeThickness" To="1.5"/>
                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Fill)">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderArrowPressedFill}"/>
                                                                </ObjectAnimationUsingKeyFrames>
                                                                <ColorAnimation BeginTime="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="(Path.Stroke).(SolidColorBrush.Color)" To="#FF003366"/>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                    </vsm:VisualStateGroup>
                                                    <vsm:VisualStateGroup x:Name="FocusStates">
                                                        <vsm:VisualState x:Name="Focused">
                                                            <Storyboard>
                                                                <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                                                </ObjectAnimationUsingKeyFrames>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                        <vsm:VisualState x:Name="Unfocused"/>
                                                    </vsm:VisualStateGroup>
                                                </vsm:VisualStateManager.VisualStateGroups>
                                                <Border Padding="{TemplateBinding Padding}">
                                                    <Grid Background="Transparent">
                                                        <Grid.ColumnDefinitions>
                                                            <ColumnDefinition Width="19"/>
                                                            <ColumnDefinition Width="*"/>
                                                        </Grid.ColumnDefinitions>
                                                        <Grid HorizontalAlignment="Left" VerticalAlignment="Top">
                                                            <Ellipse Fill="{StaticResource ExpanderArrowFill}" Height="19" HorizontalAlignment="Center" x:Name="circle" Stroke="DarkGray" VerticalAlignment="Center" Width="19"/>
                                                            <Path Data="M 1,1.5 L 4.5,5 L 8,1.5" HorizontalAlignment="Center" x:Name="arrow" Stroke="#666" StrokeThickness="2" VerticalAlignment="Center"/>
                                                        </Grid>
                                                        <ContentPresenter Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" Grid.Column="1" HorizontalAlignment="Left" Margin="4,0,0,0" x:Name="header" VerticalAlignment="Center"/>
                                                    </Grid>
                                                </Border>
                                                <Rectangle IsHitTestVisible="false" x:Name="FocusVisualElement" Stroke="Green" StrokeDashArray="1 2" StrokeThickness="1" Visibility="Collapsed"/>
                                            </Grid>
                                        </ControlTemplate>
                                        <ControlTemplate x:Key="ExpanderUpHeaderTemplate" TargetType="ToggleButton">
                                            <Grid Background="Transparent">
                                                <vsm:VisualStateManager.VisualStateGroups>
                                                    <vsm:VisualStateGroup x:Name="CheckStates">
                                                        <vsm:VisualStateGroup.Transitions>
                                                            <vsm:VisualTransition GeneratedDuration="00:00:00"/>
                                                        </vsm:VisualStateGroup.Transitions>
                                                        <vsm:VisualState x:Name="Checked">
                                                            <Storyboard>
                                                                <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="Data">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="M 1,4.5 L 4.5,1 L 8,4.5"/>
                                                                </ObjectAnimationUsingKeyFrames>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                        <vsm:VisualState x:Name="Unchecked"/>
                                                    </vsm:VisualStateGroup>
                                                    <vsm:VisualStateGroup x:Name="CommonStates">
                                                        <vsm:VisualStateGroup.Transitions>
                                                            <vsm:VisualTransition GeneratedDuration="0"/>
                                                            <vsm:VisualTransition GeneratedDuration="00:00:00.1" To="MouseOver"/>
                                                            <vsm:VisualTransition GeneratedDuration="00:00:00.1" To="Pressed"/>
                                                        </vsm:VisualStateGroup.Transitions>
                                                        <vsm:VisualState x:Name="Normal"/>
                                                        <vsm:VisualState x:Name="MouseOver">
                                                            <Storyboard>
                                                                <ColorAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Stroke).(SolidColorBrush.Color)" To="#FF3C7FB1"/>
                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Fill)">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderArrowHoverFill}"/>
                                                                </ObjectAnimationUsingKeyFrames>
                                                                <ColorAnimation BeginTime="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="(Path.Stroke).(SolidColorBrush.Color)" To="#222"/>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                        <vsm:VisualState x:Name="Pressed">
                                                            <Storyboard>
                                                                <ColorAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Stroke).(SolidColorBrush.Color)" To="#FF526C7B"/>
                                                                <DoubleAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="StrokeThickness" To="1.5"/>
                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Fill)">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderArrowPressedFill}"/>
                                                                </ObjectAnimationUsingKeyFrames>
                                                                <ColorAnimation BeginTime="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="(Path.Stroke).(SolidColorBrush.Color)" To="#FF003366"/>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                    </vsm:VisualStateGroup>
                                                    <vsm:VisualStateGroup x:Name="FocusStates">
                                                        <vsm:VisualState x:Name="Focused">
                                                            <Storyboard>
                                                                <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                                                </ObjectAnimationUsingKeyFrames>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                        <vsm:VisualState x:Name="Unfocused"/>
                                                    </vsm:VisualStateGroup>
                                                </vsm:VisualStateManager.VisualStateGroups>
                                                <Border Padding="{TemplateBinding Padding}">
                                                    <Grid Background="Transparent">
                                                        <Grid.ColumnDefinitions>
                                                            <ColumnDefinition Width="19"/>
                                                            <ColumnDefinition Width="*"/>
                                                        </Grid.ColumnDefinitions>
                                                        <Grid HorizontalAlignment="Left" VerticalAlignment="Top">
                                                            <Grid.RenderTransform>
                                                                <TransformGroup>
                                                                    <TransformGroup.Children>
                                                                        <TransformCollection>
                                                                            <RotateTransform Angle="180" CenterX="9.5" CenterY="9.5"/>
                                                                        </TransformCollection>
                                                                    </TransformGroup.Children>
                                                                </TransformGroup>
                                                            </Grid.RenderTransform>
                                                            <Ellipse Fill="{StaticResource ExpanderArrowFill}" Height="19" HorizontalAlignment="Center" x:Name="circle" Stroke="DarkGray" VerticalAlignment="Center" Width="19"/>
                                                            <Path Data="M 1,1.5 L 4.5,5 L 8,1.5" HorizontalAlignment="Center" x:Name="arrow" Stroke="#666" StrokeThickness="2" VerticalAlignment="Center"/>
                                                        </Grid>
                                                        <ContentPresenter Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" Grid.Column="1" HorizontalAlignment="Left" Margin="4,0,0,0" x:Name="header" VerticalAlignment="Center"/>
                                                    </Grid>
                                                </Border>
                                                <Rectangle IsHitTestVisible="false" x:Name="FocusVisualElement" Stroke="Green" StrokeDashArray="1 2" StrokeThickness="1" Visibility="Collapsed"/>
                                            </Grid>
                                        </ControlTemplate>
                                        <ControlTemplate x:Key="ExpanderLeftHeaderTemplate" TargetType="ToggleButton">
                                            <Grid Background="Transparent">
                                                <vsm:VisualStateManager.VisualStateGroups>
                                                    <vsm:VisualStateGroup x:Name="CheckStates">
                                                        <vsm:VisualStateGroup.Transitions>
                                                            <vsm:VisualTransition GeneratedDuration="00:00:00"/>
                                                        </vsm:VisualStateGroup.Transitions>
                                                        <vsm:VisualState x:Name="Checked">
                                                            <Storyboard>
                                                                <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="Data">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="M 1,4.5 L 4.5,1 L 8,4.5"/>
                                                                </ObjectAnimationUsingKeyFrames>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                        <vsm:VisualState x:Name="Unchecked"/>
                                                    </vsm:VisualStateGroup>
                                                    <vsm:VisualStateGroup x:Name="CommonStates">
                                                        <vsm:VisualStateGroup.Transitions>
                                                            <vsm:VisualTransition GeneratedDuration="0"/>
                                                            <vsm:VisualTransition GeneratedDuration="00:00:00.1" To="MouseOver"/>
                                                            <vsm:VisualTransition GeneratedDuration="00:00:00.1" To="Pressed"/>
                                                        </vsm:VisualStateGroup.Transitions>
                                                        <vsm:VisualState x:Name="Normal"/>
                                                        <vsm:VisualState x:Name="MouseOver">
                                                            <Storyboard>
                                                                <ColorAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Stroke).(SolidColorBrush.Color)" To="#FF3C7FB1"/>
                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Fill)">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderArrowHoverFill}"/>
                                                                </ObjectAnimationUsingKeyFrames>
                                                                <ColorAnimation BeginTime="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="(Path.Stroke).(SolidColorBrush.Color)" To="#222"/>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                        <vsm:VisualState x:Name="Pressed">
                                                            <Storyboard>
                                                                <ColorAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Stroke).(SolidColorBrush.Color)" To="#FF526C7B"/>
                                                                <DoubleAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="StrokeThickness" To="1.5"/>
                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Fill)">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderArrowPressedFill}"/>
                                                                </ObjectAnimationUsingKeyFrames>
                                                                <ColorAnimation BeginTime="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="(Path.Stroke).(SolidColorBrush.Color)" To="#FF003366"/>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                    </vsm:VisualStateGroup>
                                                    <vsm:VisualStateGroup x:Name="FocusStates">
                                                        <vsm:VisualState x:Name="Focused">
                                                            <Storyboard>
                                                                <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                                                </ObjectAnimationUsingKeyFrames>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                        <vsm:VisualState x:Name="Unfocused"/>
                                                    </vsm:VisualStateGroup>
                                                </vsm:VisualStateManager.VisualStateGroups>
                                                <Border Padding="{TemplateBinding Padding}">
                                                    <Grid Background="Transparent">
                                                        <Grid.RowDefinitions>
                                                            <RowDefinition Height="19"/>
                                                            <RowDefinition Height="*"/>
                                                        </Grid.RowDefinitions>
                                                        <Grid HorizontalAlignment="Center" VerticalAlignment="Top">
                                                            <Grid.RenderTransform>
                                                                <TransformGroup>
                                                                    <TransformGroup.Children>
                                                                        <TransformCollection>
                                                                            <RotateTransform Angle="90" CenterX="9.5" CenterY="9.5"/>
                                                                        </TransformCollection>
                                                                    </TransformGroup.Children>
                                                                </TransformGroup>
                                                            </Grid.RenderTransform>
                                                            <Ellipse Fill="{StaticResource ExpanderArrowFill}" Height="19" HorizontalAlignment="Center" x:Name="circle" Width="19" Stroke="DarkGray" VerticalAlignment="Center"/>
                                                            <Path Data="M 1,1.5 L 4.5,5 L 8,1.5" HorizontalAlignment="Center" x:Name="arrow" Stroke="#666" StrokeThickness="2" VerticalAlignment="Center"/>
                                                        </Grid>
                                                        <ContentPresenter Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" Grid.Row="1" HorizontalAlignment="Center" Margin="0,4,0,0" x:Name="header" VerticalAlignment="Top"/>
                                                    </Grid>
                                                </Border>
                                                <Rectangle IsHitTestVisible="false" x:Name="FocusVisualElement" Stroke="Green" StrokeDashArray="1 2" StrokeThickness="1" Visibility="Collapsed"/>
                                            </Grid>
                                        </ControlTemplate>
                                        <ControlTemplate x:Key="ExpanderRightHeaderTemplate" TargetType="ToggleButton">
                                            <Grid Background="Transparent">
                                                <vsm:VisualStateManager.VisualStateGroups>
                                                    <vsm:VisualStateGroup x:Name="CheckStates">
                                                        <vsm:VisualStateGroup.Transitions>
                                                            <vsm:VisualTransition GeneratedDuration="00:00:00"/>
                                                        </vsm:VisualStateGroup.Transitions>
                                                        <vsm:VisualState x:Name="Checked">
                                                            <Storyboard>
                                                                <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="Data">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="M 1,4.5 L 4.5,1 L 8,4.5"/>
                                                                </ObjectAnimationUsingKeyFrames>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                        <vsm:VisualState x:Name="Unchecked"/>
                                                    </vsm:VisualStateGroup>
                                                    <vsm:VisualStateGroup x:Name="CommonStates">
                                                        <vsm:VisualStateGroup.Transitions>
                                                            <vsm:VisualTransition GeneratedDuration="0"/>
                                                            <vsm:VisualTransition GeneratedDuration="00:00:00.1" To="MouseOver"/>
                                                            <vsm:VisualTransition GeneratedDuration="00:00:00.1" To="Pressed"/>
                                                        </vsm:VisualStateGroup.Transitions>
                                                        <vsm:VisualState x:Name="Normal"/>
                                                        <vsm:VisualState x:Name="MouseOver">
                                                            <Storyboard>
                                                                <ColorAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Stroke).(SolidColorBrush.Color)" To="#FF3C7FB1"/>
                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Fill)">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderArrowHoverFill}"/>
                                                                </ObjectAnimationUsingKeyFrames>
                                                                <ColorAnimation BeginTime="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="(Path.Stroke).(SolidColorBrush.Color)" To="#222"/>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                        <vsm:VisualState x:Name="Pressed">
                                                            <Storyboard>
                                                                <ColorAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Stroke).(SolidColorBrush.Color)" To="#FF526C7B"/>
                                                                <DoubleAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="StrokeThickness" To="1.5"/>
                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Fill)">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderArrowPressedFill}"/>
                                                                </ObjectAnimationUsingKeyFrames>
                                                                <ColorAnimation BeginTime="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="(Path.Stroke).(SolidColorBrush.Color)" To="#FF003366"/>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                    </vsm:VisualStateGroup>
                                                    <vsm:VisualStateGroup x:Name="FocusStates">
                                                        <vsm:VisualState x:Name="Focused">
                                                            <Storyboard>
                                                                <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                                                </ObjectAnimationUsingKeyFrames>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                        <vsm:VisualState x:Name="Unfocused"/>
                                                    </vsm:VisualStateGroup>
                                                </vsm:VisualStateManager.VisualStateGroups>
                                                <Border Padding="{TemplateBinding Padding}">
                                                    <Grid Background="Transparent">
                                                        <Grid.RowDefinitions>
                                                            <RowDefinition Height="19"/>
                                                            <RowDefinition Height="*"/>
                                                        </Grid.RowDefinitions>
                                                        <Grid HorizontalAlignment="Center" VerticalAlignment="Top">
                                                            <Grid.RenderTransform>
                                                                <TransformGroup>
                                                                    <TransformGroup.Children>
                                                                        <TransformCollection>
                                                                            <RotateTransform Angle="270" CenterX="9.5" CenterY="9.5"/>
                                                                        </TransformCollection>
                                                                    </TransformGroup.Children>
                                                                </TransformGroup>
                                                            </Grid.RenderTransform>
                                                            <Ellipse Fill="{StaticResource ExpanderArrowFill}" Height="19" HorizontalAlignment="Center" x:Name="circle" Stroke="DarkGray" VerticalAlignment="Center" Width="19"/>
                                                            <Path Data="M 1,1.5 L 4.5,5 L 8,1.5" HorizontalAlignment="Center" x:Name="arrow" Stroke="#666" StrokeThickness="2" VerticalAlignment="Center"/>
                                                        </Grid>
                                                        <ContentPresenter Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" Grid.Row="1" HorizontalAlignment="Center" Margin="0,4,0,0" x:Name="header" VerticalAlignment="Top"/>
                                                    </Grid>
                                                </Border>
                                                <Rectangle IsHitTestVisible="false" x:Name="FocusVisualElement" Stroke="Green" StrokeDashArray="1 2" StrokeThickness="1" Visibility="Collapsed"/>
                                            </Grid>
                                        </ControlTemplate>
                                    </Grid.Resources>
                                    <vsm:VisualStateManager.VisualStateGroups>
                                        <vsm:VisualStateGroup x:Name="CommonStates">
                                            <vsm:VisualStateGroup.Transitions>
                                                <vsm:VisualTransition GeneratedDuration="0"/>
                                            </vsm:VisualStateGroup.Transitions>
                                            <vsm:VisualState x:Name="Normal"/>
                                            <vsm:VisualState x:Name="Disabled">
                                                <Storyboard>
                                                    <DoubleAnimation Duration="0" Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="(UIElement.Opacity)" To="1"/>
                                                </Storyboard>
                                            </vsm:VisualState>
                                        </vsm:VisualStateGroup>
                                        <vsm:VisualStateGroup x:Name="FocusStates">
                                            <vsm:VisualState x:Name="Focused">
                                                <Storyboard>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </vsm:VisualState>
                                            <vsm:VisualState x:Name="Unfocused"/>
                                        </vsm:VisualStateGroup>
                                        <vsm:VisualStateGroup x:Name="ExpansionStates">
                                            <vsm:VisualStateGroup.Transitions>
                                                <vsm:VisualTransition GeneratedDuration="00:00:00.2000000"/>
                                            </vsm:VisualStateGroup.Transitions>
                                            <vsm:VisualState x:Name="Collapsed">
                                                <Storyboard>
                                                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                        <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                                    </DoubleAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </vsm:VisualState>
                                            <vsm:VisualState x:Name="Expanded"/>
                                        </vsm:VisualStateGroup>
                                        <vsm:VisualStateGroup x:Name="ExpandDirectionStates">
                                            <vsm:VisualStateGroup.Transitions>
                                                <vsm:VisualTransition GeneratedDuration="0"/>
                                            </vsm:VisualStateGroup.Transitions>
                                            <vsm:VisualState x:Name="ExpandDown">
                                                <Storyboard>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="rd1" Storyboard.TargetProperty="Height">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="cd0" Storyboard.TargetProperty="Width">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </vsm:VisualState>
                                            <vsm:VisualState x:Name="ExpandUp">
                                                <Storyboard>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="Template">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderUpHeaderTemplate}"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="(Grid.Row)">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="1"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(Grid.Row)">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="0"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="rd0" Storyboard.TargetProperty="Height">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="cd0" Storyboard.TargetProperty="Width">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </vsm:VisualState>
                                            <vsm:VisualState x:Name="ExpandLeft">
                                                <Storyboard>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="Template">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderLeftHeaderTemplate}"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="(Grid.Column)">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="1"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(Grid.Row)">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="0"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="rd0" Storyboard.TargetProperty="Height">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="cd0" Storyboard.TargetProperty="Width">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </vsm:VisualState>
                                            <vsm:VisualState x:Name="ExpandRight">
                                                <Storyboard>
                                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="Template">
                                                        <DiscreteObjectKeyFrame KeyTime="00:00:00.1000000" Value="{StaticResource ExpanderLeftHeaderTemplate}"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(Grid.Row)">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="0"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(Grid.Column)">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="1"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="rd0" Storyboard.TargetProperty="Height">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="cd1" Storyboard.TargetProperty="Width">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </vsm:VisualState>
                                        </vsm:VisualStateGroup>
                                    </vsm:VisualStateManager.VisualStateGroups>
                                    <Border x:Name="Background" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3">
                                        <Grid>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="Auto" x:Name="rd0"/>
                                                <RowDefinition Height="Auto" x:Name="rd1"/>
                                            </Grid.RowDefinitions>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="Auto" x:Name="cd0"/>
                                                <ColumnDefinition Width="Auto" x:Name="cd1"/>
                                            </Grid.ColumnDefinitions>
                                            <ToggleButton Content="{TemplateBinding Header}" ContentTemplate="{TemplateBinding HeaderTemplate}" FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}" FontStretch="{TemplateBinding FontStretch}" FontStyle="{TemplateBinding FontStyle}" FontWeight="{TemplateBinding FontWeight}" Foreground="{TemplateBinding Foreground}" Grid.Column="0" Grid.Row="0" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" IsChecked="{TemplateBinding IsExpanded}" Margin="1" MinHeight="0" MinWidth="0" x:Name="ExpanderButton" Padding="{TemplateBinding Padding}" Template="{StaticResource ExpanderDownHeaderTemplate}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
                                            <ContentControl Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}" FontStretch="{TemplateBinding FontStretch}" FontStyle="{TemplateBinding FontStyle}" FontWeight="{TemplateBinding FontWeight}" Foreground="{TemplateBinding Foreground}" Grid.Column="0" Grid.Row="1" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" x:Name="ExpandSite" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" Visibility="Visible" Opacity="1"/>
                                        </Grid>
                                    </Border>
                                    <Border x:Name="DisabledVisualElement" IsHitTestVisible="false" Opacity="0" Background="#A5FFFFFF" CornerRadius="3"/>
                                    <Border x:Name="FocusVisualElement" IsHitTestVisible="false" Visibility="Collapsed" BorderThickness="1" CornerRadius="3">
                                        <Border.BorderBrush>
                                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                <GradientStop Color="#FFA3AEB9"/>
                                                <GradientStop Color="#FF8399A9" Offset="0.375"/>
                                                <GradientStop Color="#FF718597" Offset="0.375"/>
                                                <GradientStop Color="#FF617584" Offset="1"/>
                                            </LinearGradientBrush>
                                        </Border.BorderBrush>
                                    </Border>
                                </Grid>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
                <Style x:Key="ExpanderScaleStyle" TargetType="toolkit:Expander">
                    <Setter Property="Background" Value="Transparent"/>
                    <Setter Property="BorderBrush" Value="Transparent"/>
                    <Setter Property="BorderThickness" Value="1"/>
                    <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                    <Setter Property="VerticalContentAlignment" Value="Stretch"/>
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="toolkit:Expander">
                                <Grid Background="Transparent">
                                    <Grid.Resources>
                                        <LinearGradientBrush x:Key="ExpanderArrowFill" EndPoint="0,1" StartPoint="0,0">
                                            <GradientStop Color="White" Offset="0"/>
                                            <GradientStop Color="#FFBFBFBF" Offset="0.5"/>
                                            <GradientStop Color="#FF878787" Offset="1"/>
                                        </LinearGradientBrush>
                                        <LinearGradientBrush x:Key="ExpanderArrowHoverFill" EndPoint="0,1" StartPoint="0,0">
                                            <GradientStop Color="#FFF0F8FE" Offset="0"/>
                                            <GradientStop Color="#FFE0F3FE" Offset="0.3"/>
                                            <GradientStop Color="#FF6FA7C5" Offset="1"/>
                                        </LinearGradientBrush>
                                        <LinearGradientBrush x:Key="ExpanderArrowPressedFill" EndPoint="0,1" StartPoint="0,0">
                                            <GradientStop Color="#FFDCF0FA" Offset="0"/>
                                            <GradientStop Color="#FFC5E6F7" Offset="0.2"/>
                                            <GradientStop Color="#FF5690D0" Offset="1"/>
                                        </LinearGradientBrush>
                                        <ControlTemplate x:Key="ExpanderDownHeaderTemplate" TargetType="ToggleButton">
                                            <Grid Background="Transparent">
                                                <vsm:VisualStateManager.VisualStateGroups>
                                                    <vsm:VisualStateGroup x:Name="CheckStates">
                                                        <vsm:VisualStateGroup.Transitions>
                                                            <vsm:VisualTransition GeneratedDuration="00:00:00"/>
                                                        </vsm:VisualStateGroup.Transitions>
                                                        <vsm:VisualState x:Name="Checked">
                                                            <Storyboard>
                                                                <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="Data">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="M 1,4.5 L 4.5,1 L 8,4.5"/>
                                                                </ObjectAnimationUsingKeyFrames>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                        <vsm:VisualState x:Name="Unchecked"/>
                                                    </vsm:VisualStateGroup>
                                                    <vsm:VisualStateGroup x:Name="CommonStates">
                                                        <vsm:VisualStateGroup.Transitions>
                                                            <vsm:VisualTransition GeneratedDuration="0"/>
                                                            <vsm:VisualTransition GeneratedDuration="00:00:00.1" To="MouseOver"/>
                                                            <vsm:VisualTransition GeneratedDuration="00:00:00.1" To="Pressed"/>
                                                        </vsm:VisualStateGroup.Transitions>
                                                        <vsm:VisualState x:Name="Normal"/>
                                                        <vsm:VisualState x:Name="MouseOver">
                                                            <Storyboard>
                                                                <ColorAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Stroke).(SolidColorBrush.Color)" To="#FF3C7FB1"/>
                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Fill)">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderArrowHoverFill}"/>
                                                                </ObjectAnimationUsingKeyFrames>
                                                                <ColorAnimation BeginTime="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="(Path.Stroke).(SolidColorBrush.Color)" To="#222"/>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                        <vsm:VisualState x:Name="Pressed">
                                                            <Storyboard>
                                                                <ColorAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Stroke).(SolidColorBrush.Color)" To="#FF526C7B"/>
                                                                <DoubleAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="StrokeThickness" To="1.5"/>
                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Fill)">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderArrowPressedFill}"/>
                                                                </ObjectAnimationUsingKeyFrames>
                                                                <ColorAnimation BeginTime="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="(Path.Stroke).(SolidColorBrush.Color)" To="#FF003366"/>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                    </vsm:VisualStateGroup>
                                                    <vsm:VisualStateGroup x:Name="FocusStates">
                                                        <vsm:VisualState x:Name="Focused">
                                                            <Storyboard>
                                                                <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                                                </ObjectAnimationUsingKeyFrames>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                        <vsm:VisualState x:Name="Unfocused"/>
                                                    </vsm:VisualStateGroup>
                                                </vsm:VisualStateManager.VisualStateGroups>
                                                <Border Padding="{TemplateBinding Padding}">
                                                    <Grid Background="Transparent">
                                                        <Grid.ColumnDefinitions>
                                                            <ColumnDefinition Width="19"/>
                                                            <ColumnDefinition Width="*"/>
                                                        </Grid.ColumnDefinitions>
                                                        <Grid HorizontalAlignment="Left" VerticalAlignment="Top">
                                                            <Ellipse Fill="{StaticResource ExpanderArrowFill}" Height="19" HorizontalAlignment="Center" x:Name="circle" Stroke="DarkGray" VerticalAlignment="Center" Width="19"/>
                                                            <Path Data="M 1,1.5 L 4.5,5 L 8,1.5" HorizontalAlignment="Center" x:Name="arrow" Stroke="#666" StrokeThickness="2" VerticalAlignment="Center"/>
                                                        </Grid>
                                                        <ContentPresenter Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" Grid.Column="1" HorizontalAlignment="Left" Margin="4,0,0,0" x:Name="header" VerticalAlignment="Center"/>
                                                    </Grid>
                                                </Border>
                                                <Rectangle IsHitTestVisible="false" x:Name="FocusVisualElement" Stroke="Green" StrokeDashArray="1 2" StrokeThickness="1" Visibility="Collapsed"/>
                                            </Grid>
                                        </ControlTemplate>
                                        <ControlTemplate x:Key="ExpanderUpHeaderTemplate" TargetType="ToggleButton">
                                            <Grid Background="Transparent">
                                                <vsm:VisualStateManager.VisualStateGroups>
                                                    <vsm:VisualStateGroup x:Name="CheckStates">
                                                        <vsm:VisualStateGroup.Transitions>
                                                            <vsm:VisualTransition GeneratedDuration="00:00:00"/>
                                                        </vsm:VisualStateGroup.Transitions>
                                                        <vsm:VisualState x:Name="Checked">
                                                            <Storyboard>
                                                                <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="Data">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="M 1,4.5 L 4.5,1 L 8,4.5"/>
                                                                </ObjectAnimationUsingKeyFrames>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                        <vsm:VisualState x:Name="Unchecked"/>
                                                    </vsm:VisualStateGroup>
                                                    <vsm:VisualStateGroup x:Name="CommonStates">
                                                        <vsm:VisualStateGroup.Transitions>
                                                            <vsm:VisualTransition GeneratedDuration="0"/>
                                                            <vsm:VisualTransition GeneratedDuration="00:00:00.1" To="MouseOver"/>
                                                            <vsm:VisualTransition GeneratedDuration="00:00:00.1" To="Pressed"/>
                                                        </vsm:VisualStateGroup.Transitions>
                                                        <vsm:VisualState x:Name="Normal"/>
                                                        <vsm:VisualState x:Name="MouseOver">
                                                            <Storyboard>
                                                                <ColorAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Stroke).(SolidColorBrush.Color)" To="#FF3C7FB1"/>
                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Fill)">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderArrowHoverFill}"/>
                                                                </ObjectAnimationUsingKeyFrames>
                                                                <ColorAnimation BeginTime="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="(Path.Stroke).(SolidColorBrush.Color)" To="#222"/>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                        <vsm:VisualState x:Name="Pressed">
                                                            <Storyboard>
                                                                <ColorAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Stroke).(SolidColorBrush.Color)" To="#FF526C7B"/>
                                                                <DoubleAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="StrokeThickness" To="1.5"/>
                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Fill)">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderArrowPressedFill}"/>
                                                                </ObjectAnimationUsingKeyFrames>
                                                                <ColorAnimation BeginTime="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="(Path.Stroke).(SolidColorBrush.Color)" To="#FF003366"/>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                    </vsm:VisualStateGroup>
                                                    <vsm:VisualStateGroup x:Name="FocusStates">
                                                        <vsm:VisualState x:Name="Focused">
                                                            <Storyboard>
                                                                <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                                                </ObjectAnimationUsingKeyFrames>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                        <vsm:VisualState x:Name="Unfocused"/>
                                                    </vsm:VisualStateGroup>
                                                </vsm:VisualStateManager.VisualStateGroups>
                                                <Border Padding="{TemplateBinding Padding}">
                                                    <Grid Background="Transparent">
                                                        <Grid.ColumnDefinitions>
                                                            <ColumnDefinition Width="19"/>
                                                            <ColumnDefinition Width="*"/>
                                                        </Grid.ColumnDefinitions>
                                                        <Grid HorizontalAlignment="Left" VerticalAlignment="Top">
                                                            <Grid.RenderTransform>
                                                                <TransformGroup>
                                                                    <TransformGroup.Children>
                                                                        <TransformCollection>
                                                                            <RotateTransform Angle="180" CenterX="9.5" CenterY="9.5"/>
                                                                        </TransformCollection>
                                                                    </TransformGroup.Children>
                                                                </TransformGroup>
                                                            </Grid.RenderTransform>
                                                            <Ellipse Fill="{StaticResource ExpanderArrowFill}" Height="19" HorizontalAlignment="Center" x:Name="circle" Stroke="DarkGray" VerticalAlignment="Center" Width="19"/>
                                                            <Path Data="M 1,1.5 L 4.5,5 L 8,1.5" HorizontalAlignment="Center" x:Name="arrow" Stroke="#666" StrokeThickness="2" VerticalAlignment="Center"/>
                                                        </Grid>
                                                        <ContentPresenter Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" Grid.Column="1" HorizontalAlignment="Left" Margin="4,0,0,0" x:Name="header" VerticalAlignment="Center"/>
                                                    </Grid>
                                                </Border>
                                                <Rectangle IsHitTestVisible="false" x:Name="FocusVisualElement" Stroke="Green" StrokeDashArray="1 2" StrokeThickness="1" Visibility="Collapsed"/>
                                            </Grid>
                                        </ControlTemplate>
                                        <ControlTemplate x:Key="ExpanderLeftHeaderTemplate" TargetType="ToggleButton">
                                            <Grid Background="Transparent">
                                                <vsm:VisualStateManager.VisualStateGroups>
                                                    <vsm:VisualStateGroup x:Name="CheckStates">
                                                        <vsm:VisualStateGroup.Transitions>
                                                            <vsm:VisualTransition GeneratedDuration="00:00:00"/>
                                                        </vsm:VisualStateGroup.Transitions>
                                                        <vsm:VisualState x:Name="Checked">
                                                            <Storyboard>
                                                                <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="Data">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="M 1,4.5 L 4.5,1 L 8,4.5"/>
                                                                </ObjectAnimationUsingKeyFrames>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                        <vsm:VisualState x:Name="Unchecked"/>
                                                    </vsm:VisualStateGroup>
                                                    <vsm:VisualStateGroup x:Name="CommonStates">
                                                        <vsm:VisualStateGroup.Transitions>
                                                            <vsm:VisualTransition GeneratedDuration="0"/>
                                                            <vsm:VisualTransition GeneratedDuration="00:00:00.1" To="MouseOver"/>
                                                            <vsm:VisualTransition GeneratedDuration="00:00:00.1" To="Pressed"/>
                                                        </vsm:VisualStateGroup.Transitions>
                                                        <vsm:VisualState x:Name="Normal"/>
                                                        <vsm:VisualState x:Name="MouseOver">
                                                            <Storyboard>
                                                                <ColorAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Stroke).(SolidColorBrush.Color)" To="#FF3C7FB1"/>
                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Fill)">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderArrowHoverFill}"/>
                                                                </ObjectAnimationUsingKeyFrames>
                                                                <ColorAnimation BeginTime="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="(Path.Stroke).(SolidColorBrush.Color)" To="#222"/>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                        <vsm:VisualState x:Name="Pressed">
                                                            <Storyboard>
                                                                <ColorAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Stroke).(SolidColorBrush.Color)" To="#FF526C7B"/>
                                                                <DoubleAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="StrokeThickness" To="1.5"/>
                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Fill)">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderArrowPressedFill}"/>
                                                                </ObjectAnimationUsingKeyFrames>
                                                                <ColorAnimation BeginTime="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="(Path.Stroke).(SolidColorBrush.Color)" To="#FF003366"/>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                    </vsm:VisualStateGroup>
                                                    <vsm:VisualStateGroup x:Name="FocusStates">
                                                        <vsm:VisualState x:Name="Focused">
                                                            <Storyboard>
                                                                <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                                                </ObjectAnimationUsingKeyFrames>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                        <vsm:VisualState x:Name="Unfocused"/>
                                                    </vsm:VisualStateGroup>
                                                </vsm:VisualStateManager.VisualStateGroups>
                                                <Border Padding="{TemplateBinding Padding}">
                                                    <Grid Background="Transparent">
                                                        <Grid.RowDefinitions>
                                                            <RowDefinition Height="19"/>
                                                            <RowDefinition Height="*"/>
                                                        </Grid.RowDefinitions>
                                                        <Grid HorizontalAlignment="Center" VerticalAlignment="Top">
                                                            <Grid.RenderTransform>
                                                                <TransformGroup>
                                                                    <TransformGroup.Children>
                                                                        <TransformCollection>
                                                                            <RotateTransform Angle="90" CenterX="9.5" CenterY="9.5"/>
                                                                        </TransformCollection>
                                                                    </TransformGroup.Children>
                                                                </TransformGroup>
                                                            </Grid.RenderTransform>
                                                            <Ellipse Fill="{StaticResource ExpanderArrowFill}" Height="19" HorizontalAlignment="Center" x:Name="circle" Width="19" Stroke="DarkGray" VerticalAlignment="Center"/>
                                                            <Path Data="M 1,1.5 L 4.5,5 L 8,1.5" HorizontalAlignment="Center" x:Name="arrow" Stroke="#666" StrokeThickness="2" VerticalAlignment="Center"/>
                                                        </Grid>
                                                        <ContentPresenter Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" Grid.Row="1" HorizontalAlignment="Center" Margin="0,4,0,0" x:Name="header" VerticalAlignment="Top"/>
                                                    </Grid>
                                                </Border>
                                                <Rectangle IsHitTestVisible="false" x:Name="FocusVisualElement" Stroke="Green" StrokeDashArray="1 2" StrokeThickness="1" Visibility="Collapsed"/>
                                            </Grid>
                                        </ControlTemplate>
                                        <ControlTemplate x:Key="ExpanderRightHeaderTemplate" TargetType="ToggleButton">
                                            <Grid Background="Transparent">
                                                <vsm:VisualStateManager.VisualStateGroups>
                                                    <vsm:VisualStateGroup x:Name="CheckStates">
                                                        <vsm:VisualStateGroup.Transitions>
                                                            <vsm:VisualTransition GeneratedDuration="00:00:00"/>
                                                        </vsm:VisualStateGroup.Transitions>
                                                        <vsm:VisualState x:Name="Checked">
                                                            <Storyboard>
                                                                <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="Data">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="M 1,4.5 L 4.5,1 L 8,4.5"/>
                                                                </ObjectAnimationUsingKeyFrames>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                        <vsm:VisualState x:Name="Unchecked"/>
                                                    </vsm:VisualStateGroup>
                                                    <vsm:VisualStateGroup x:Name="CommonStates">
                                                        <vsm:VisualStateGroup.Transitions>
                                                            <vsm:VisualTransition GeneratedDuration="0"/>
                                                            <vsm:VisualTransition GeneratedDuration="00:00:00.1" To="MouseOver"/>
                                                            <vsm:VisualTransition GeneratedDuration="00:00:00.1" To="Pressed"/>
                                                        </vsm:VisualStateGroup.Transitions>
                                                        <vsm:VisualState x:Name="Normal"/>
                                                        <vsm:VisualState x:Name="MouseOver">
                                                            <Storyboard>
                                                                <ColorAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Stroke).(SolidColorBrush.Color)" To="#FF3C7FB1"/>
                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Fill)">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderArrowHoverFill}"/>
                                                                </ObjectAnimationUsingKeyFrames>
                                                                <ColorAnimation BeginTime="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="(Path.Stroke).(SolidColorBrush.Color)" To="#222"/>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                        <vsm:VisualState x:Name="Pressed">
                                                            <Storyboard>
                                                                <ColorAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Stroke).(SolidColorBrush.Color)" To="#FF526C7B"/>
                                                                <DoubleAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="StrokeThickness" To="1.5"/>
                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Fill)">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderArrowPressedFill}"/>
                                                                </ObjectAnimationUsingKeyFrames>
                                                                <ColorAnimation BeginTime="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="(Path.Stroke).(SolidColorBrush.Color)" To="#FF003366"/>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                    </vsm:VisualStateGroup>
                                                    <vsm:VisualStateGroup x:Name="FocusStates">
                                                        <vsm:VisualState x:Name="Focused">
                                                            <Storyboard>
                                                                <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                                                </ObjectAnimationUsingKeyFrames>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                        <vsm:VisualState x:Name="Unfocused"/>
                                                    </vsm:VisualStateGroup>
                                                </vsm:VisualStateManager.VisualStateGroups>
                                                <Border Padding="{TemplateBinding Padding}">
                                                    <Grid Background="Transparent">
                                                        <Grid.RowDefinitions>
                                                            <RowDefinition Height="19"/>
                                                            <RowDefinition Height="*"/>
                                                        </Grid.RowDefinitions>
                                                        <Grid HorizontalAlignment="Center" VerticalAlignment="Top">
                                                            <Grid.RenderTransform>
                                                                <TransformGroup>
                                                                    <TransformGroup.Children>
                                                                        <TransformCollection>
                                                                            <RotateTransform Angle="270" CenterX="9.5" CenterY="9.5"/>
                                                                        </TransformCollection>
                                                                    </TransformGroup.Children>
                                                                </TransformGroup>
                                                            </Grid.RenderTransform>
                                                            <Ellipse Fill="{StaticResource ExpanderArrowFill}" Height="19" HorizontalAlignment="Center" x:Name="circle" Stroke="DarkGray" VerticalAlignment="Center" Width="19"/>
                                                            <Path Data="M 1,1.5 L 4.5,5 L 8,1.5" HorizontalAlignment="Center" x:Name="arrow" Stroke="#666" StrokeThickness="2" VerticalAlignment="Center"/>
                                                        </Grid>
                                                        <ContentPresenter Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" Grid.Row="1" HorizontalAlignment="Center" Margin="0,4,0,0" x:Name="header" VerticalAlignment="Top"/>
                                                    </Grid>
                                                </Border>
                                                <Rectangle IsHitTestVisible="false" x:Name="FocusVisualElement" Stroke="Green" StrokeDashArray="1 2" StrokeThickness="1" Visibility="Collapsed"/>
                                            </Grid>
                                        </ControlTemplate>
                                    </Grid.Resources>
                                    <vsm:VisualStateManager.VisualStateGroups>
                                        <vsm:VisualStateGroup x:Name="CommonStates">
                                            <vsm:VisualStateGroup.Transitions>
                                                <vsm:VisualTransition GeneratedDuration="0"/>
                                            </vsm:VisualStateGroup.Transitions>
                                            <vsm:VisualState x:Name="Normal"/>
                                            <vsm:VisualState x:Name="Disabled">
                                                <Storyboard>
                                                    <DoubleAnimation Duration="0" Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="(UIElement.Opacity)" To="1"/>
                                                </Storyboard>
                                            </vsm:VisualState>
                                        </vsm:VisualStateGroup>
                                        <vsm:VisualStateGroup x:Name="FocusStates">
                                            <vsm:VisualState x:Name="Focused">
                                                <Storyboard>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </vsm:VisualState>
                                            <vsm:VisualState x:Name="Unfocused"/>
                                        </vsm:VisualStateGroup>
                                        <vsm:VisualStateGroup x:Name="ExpansionStates">
                                            <vsm:VisualStateGroup.Transitions>
                                                <vsm:VisualTransition GeneratedDuration="00:00:00.2000000"/>
                                            </vsm:VisualStateGroup.Transitions>
                                            <vsm:VisualState x:Name="Collapsed">
                                                <Storyboard>
                                                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
                                                        <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                                    </DoubleAnimationUsingKeyFrames>
                                                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
                                                        <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                                    </DoubleAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </vsm:VisualState>
                                            <vsm:VisualState x:Name="Expanded"/>
                                        </vsm:VisualStateGroup>
                                        <vsm:VisualStateGroup x:Name="ExpandDirectionStates">
                                            <vsm:VisualStateGroup.Transitions>
                                                <vsm:VisualTransition GeneratedDuration="0"/>
                                            </vsm:VisualStateGroup.Transitions>
                                            <vsm:VisualState x:Name="ExpandDown">
                                                <Storyboard>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="rd1" Storyboard.TargetProperty="Height">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="cd0" Storyboard.TargetProperty="Width">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </vsm:VisualState>
                                            <vsm:VisualState x:Name="ExpandUp">
                                                <Storyboard>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="Template">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderUpHeaderTemplate}"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="(Grid.Row)">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="1"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(Grid.Row)">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="0"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="rd0" Storyboard.TargetProperty="Height">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="cd0" Storyboard.TargetProperty="Width">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </vsm:VisualState>
                                            <vsm:VisualState x:Name="ExpandLeft">
                                                <Storyboard>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="Template">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderLeftHeaderTemplate}"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="(Grid.Column)">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="1"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(Grid.Row)">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="0"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="rd0" Storyboard.TargetProperty="Height">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="cd0" Storyboard.TargetProperty="Width">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </vsm:VisualState>
                                            <vsm:VisualState x:Name="ExpandRight">
                                                <Storyboard>
                                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="Template">
                                                        <DiscreteObjectKeyFrame KeyTime="00:00:00.1000000" Value="{StaticResource ExpanderLeftHeaderTemplate}"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(Grid.Row)">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="0"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(Grid.Column)">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="1"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="rd0" Storyboard.TargetProperty="Height">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="cd1" Storyboard.TargetProperty="Width">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </vsm:VisualState>
                                        </vsm:VisualStateGroup>
                                    </vsm:VisualStateManager.VisualStateGroups>
                                    <Border x:Name="Background" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3">
                                        <Grid>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="Auto" x:Name="rd0"/>
                                                <RowDefinition Height="Auto" x:Name="rd1"/>
                                            </Grid.RowDefinitions>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="Auto" x:Name="cd0"/>
                                                <ColumnDefinition Width="Auto" x:Name="cd1"/>
                                            </Grid.ColumnDefinitions>
                                            <ToggleButton Content="{TemplateBinding Header}" ContentTemplate="{TemplateBinding HeaderTemplate}" FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}" FontStretch="{TemplateBinding FontStretch}" FontStyle="{TemplateBinding FontStyle}" FontWeight="{TemplateBinding FontWeight}" Foreground="{TemplateBinding Foreground}" Grid.Column="0" Grid.Row="0" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" IsChecked="{TemplateBinding IsExpanded}" Margin="1" MinHeight="0" MinWidth="0" x:Name="ExpanderButton" Padding="{TemplateBinding Padding}" Template="{StaticResource ExpanderDownHeaderTemplate}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
                                            <ContentControl Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}" FontStretch="{TemplateBinding FontStretch}" FontStyle="{TemplateBinding FontStyle}" FontWeight="{TemplateBinding FontWeight}" Foreground="{TemplateBinding Foreground}" Grid.Column="0" Grid.Row="1" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" x:Name="ExpandSite" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" Visibility="Visible" Width="Auto" Height="Auto" RenderTransformOrigin="0.5,0.5">
                                                <ContentControl.RenderTransform>
                                                    <TransformGroup>
                                                        <ScaleTransform x:Name="Scale"/>
                                                        <SkewTransform/>
                                                        <RotateTransform/>
                                                        <TranslateTransform/>
                                                    </TransformGroup>
                                                </ContentControl.RenderTransform>
                                            </ContentControl>
                                        </Grid>
                                    </Border>
                                    <Border x:Name="DisabledVisualElement" IsHitTestVisible="false" Opacity="0" Background="#A5FFFFFF" CornerRadius="3"/>
                                    <Border x:Name="FocusVisualElement" IsHitTestVisible="false" Visibility="Collapsed" BorderThickness="1" CornerRadius="3">
                                        <Border.BorderBrush>
                                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                <GradientStop Color="#FFA3AEB9"/>
                                                <GradientStop Color="#FF8399A9" Offset="0.375"/>
                                                <GradientStop Color="#FF718597" Offset="0.375"/>
                                                <GradientStop Color="#FF617584" Offset="1"/>
                                            </LinearGradientBrush>
                                        </Border.BorderBrush>
                                    </Border>
                                </Grid>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
                <Style x:Key="ExpanderNoButtonStyle" TargetType="toolkit:Expander">
                    <Setter Property="Background" Value="Transparent"/>
                    <Setter Property="BorderBrush" Value="Transparent"/>
                    <Setter Property="BorderThickness" Value="1"/>
                    <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                    <Setter Property="VerticalContentAlignment" Value="Stretch"/>
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="toolkit:Expander">
                                <Grid Background="Transparent">
                                    <vsm:VisualStateManager.VisualStateGroups>
                                        <vsm:VisualStateGroup x:Name="CommonStates">
                                            <vsm:VisualStateGroup.Transitions>
                                                <vsm:VisualTransition GeneratedDuration="0"/>
                                            </vsm:VisualStateGroup.Transitions>
                                            <vsm:VisualState x:Name="Normal"/>
                                            <vsm:VisualState x:Name="Disabled">
                                                <Storyboard>
                                                    <DoubleAnimation Duration="0" Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="(UIElement.Opacity)" To="1"/>
                                                </Storyboard>
                                            </vsm:VisualState>
                                        </vsm:VisualStateGroup>
                                        <vsm:VisualStateGroup x:Name="FocusStates">
                                            <vsm:VisualState x:Name="Focused">
                                                <Storyboard>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </vsm:VisualState>
                                            <vsm:VisualState x:Name="Unfocused"/>
                                        </vsm:VisualStateGroup>
                                        <vsm:VisualStateGroup x:Name="ExpansionStates">
                                            <vsm:VisualStateGroup.Transitions>
                                                <vsm:VisualTransition GeneratedDuration="0"/>
                                            </vsm:VisualStateGroup.Transitions>
                                            <vsm:VisualState x:Name="Collapsed"/>
                                            <vsm:VisualState x:Name="Expanded">
                                                <Storyboard>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="Visibility">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </vsm:VisualState>
                                        </vsm:VisualStateGroup>
                                        <vsm:VisualStateGroup x:Name="ExpandDirectionStates">
                                            <vsm:VisualStateGroup.Transitions>
                                                <vsm:VisualTransition GeneratedDuration="0"/>
                                            </vsm:VisualStateGroup.Transitions>
                                            <vsm:VisualState x:Name="ExpandDown">
                                                <Storyboard>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="rd1" Storyboard.TargetProperty="Height">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="cd0" Storyboard.TargetProperty="Width">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </vsm:VisualState>
                                            <vsm:VisualState x:Name="ExpandUp">
                                                <Storyboard>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="(Grid.Row)">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="1"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(Grid.Row)">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="0"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="rd0" Storyboard.TargetProperty="Height">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="cd0" Storyboard.TargetProperty="Width">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </vsm:VisualState>
                                            <vsm:VisualState x:Name="ExpandLeft">
                                                <Storyboard>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="(Grid.Column)">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="1"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(Grid.Row)">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="0"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="rd0" Storyboard.TargetProperty="Height">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="cd0" Storyboard.TargetProperty="Width">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </vsm:VisualState>
                                            <vsm:VisualState x:Name="ExpandRight">
                                                <Storyboard>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(Grid.Row)">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="0"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(Grid.Column)">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="1"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="rd0" Storyboard.TargetProperty="Height">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="cd1" Storyboard.TargetProperty="Width">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </vsm:VisualState>
                                        </vsm:VisualStateGroup>
                                    </vsm:VisualStateManager.VisualStateGroups>
                                    <Border x:Name="Background" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3">
                                        <Grid>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="Auto" x:Name="rd0"/>
                                                <RowDefinition Height="Auto" x:Name="rd1"/>
                                            </Grid.RowDefinitions>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="Auto" x:Name="cd0"/>
                                                <ColumnDefinition Width="Auto" x:Name="cd1"/>
                                            </Grid.ColumnDefinitions>
                                            <ToggleButton Content="{TemplateBinding Header}" ContentTemplate="{TemplateBinding HeaderTemplate}" FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}" FontStretch="{TemplateBinding FontStretch}" FontStyle="{TemplateBinding FontStyle}" FontWeight="{TemplateBinding FontWeight}" Foreground="{TemplateBinding Foreground}" Grid.Column="0" Grid.Row="0" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" IsChecked="{TemplateBinding IsExpanded}" Margin="1" MinHeight="0" MinWidth="0" x:Name="ExpanderButton" Padding="{TemplateBinding Padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
                                            <ContentControl Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}" FontStretch="{TemplateBinding FontStretch}" FontStyle="{TemplateBinding FontStyle}" FontWeight="{TemplateBinding FontWeight}" Foreground="{TemplateBinding Foreground}" Grid.Column="0" Grid.Row="1" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" x:Name="ExpandSite" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" Visibility="Collapsed"/>
                                        </Grid>
                                    </Border>
                                    <Border x:Name="DisabledVisualElement" IsHitTestVisible="false" Opacity="0" Background="#A5FFFFFF" CornerRadius="3"/>
                                    <Border x:Name="FocusVisualElement" IsHitTestVisible="false" Visibility="Collapsed" BorderThickness="1" CornerRadius="3">
                                        <Border.BorderBrush>
                                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                <GradientStop Color="#FFA3AEB9"/>
                                                <GradientStop Color="#FF8399A9" Offset="0.375"/>
                                                <GradientStop Color="#FF718597" Offset="0.375"/>
                                                <GradientStop Color="#FF617584" Offset="1"/>
                                            </LinearGradientBrush>
                                        </Border.BorderBrush>
                                    </Border>
                                </Grid>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
                <Style x:Key="ExpanderBottomRightButtonStyle" TargetType="toolkit:Expander">
                    <Setter Property="Background" Value="Transparent"/>
                    <Setter Property="BorderBrush" Value="Transparent"/>
                    <Setter Property="BorderThickness" Value="1"/>
                    <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                    <Setter Property="VerticalContentAlignment" Value="Stretch"/>
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="toolkit:Expander">
                                <Grid Background="Transparent">
                                    <Grid.Resources>
                                        <LinearGradientBrush x:Key="ExpanderArrowFill" EndPoint="0,1" StartPoint="0,0">
                                            <GradientStop Color="White" Offset="0"/>
                                            <GradientStop Color="#FFBFBFBF" Offset="0.5"/>
                                            <GradientStop Color="#FF878787" Offset="1"/>
                                        </LinearGradientBrush>
                                        <LinearGradientBrush x:Key="ExpanderArrowHoverFill" EndPoint="0,1" StartPoint="0,0">
                                            <GradientStop Color="#FFF0F8FE" Offset="0"/>
                                            <GradientStop Color="#FFE0F3FE" Offset="0.3"/>
                                            <GradientStop Color="#FF6FA7C5" Offset="1"/>
                                        </LinearGradientBrush>
                                        <LinearGradientBrush x:Key="ExpanderArrowPressedFill" EndPoint="0,1" StartPoint="0,0">
                                            <GradientStop Color="#FFDCF0FA" Offset="0"/>
                                            <GradientStop Color="#FFC5E6F7" Offset="0.2"/>
                                            <GradientStop Color="#FF5690D0" Offset="1"/>
                                        </LinearGradientBrush>
                                        <ControlTemplate x:Key="ExpanderDownHeaderTemplate" TargetType="ToggleButton">
                                            <Grid Background="Transparent">
                                                <vsm:VisualStateManager.VisualStateGroups>
                                                    <vsm:VisualStateGroup x:Name="CheckStates">
                                                        <vsm:VisualStateGroup.Transitions>
                                                            <vsm:VisualTransition GeneratedDuration="00:00:00"/>
                                                        </vsm:VisualStateGroup.Transitions>
                                                        <vsm:VisualState x:Name="Checked">
                                                            <Storyboard>
                                                                <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="Data">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="M 1,4.5 L 4.5,1 L 8,4.5"/>
                                                                </ObjectAnimationUsingKeyFrames>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                        <vsm:VisualState x:Name="Unchecked"/>
                                                    </vsm:VisualStateGroup>
                                                    <vsm:VisualStateGroup x:Name="CommonStates">
                                                        <vsm:VisualStateGroup.Transitions>
                                                            <vsm:VisualTransition GeneratedDuration="0"/>
                                                            <vsm:VisualTransition GeneratedDuration="00:00:00.1" To="MouseOver"/>
                                                            <vsm:VisualTransition GeneratedDuration="00:00:00.1" To="Pressed"/>
                                                        </vsm:VisualStateGroup.Transitions>
                                                        <vsm:VisualState x:Name="Normal"/>
                                                        <vsm:VisualState x:Name="MouseOver">
                                                            <Storyboard>
                                                                <ColorAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Stroke).(SolidColorBrush.Color)" To="#FF3C7FB1"/>
                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Fill)">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderArrowHoverFill}"/>
                                                                </ObjectAnimationUsingKeyFrames>
                                                                <ColorAnimation BeginTime="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="(Path.Stroke).(SolidColorBrush.Color)" To="#222"/>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                        <vsm:VisualState x:Name="Pressed">
                                                            <Storyboard>
                                                                <ColorAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Stroke).(SolidColorBrush.Color)" To="#FF526C7B"/>
                                                                <DoubleAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="StrokeThickness" To="1.5"/>
                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Fill)">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderArrowPressedFill}"/>
                                                                </ObjectAnimationUsingKeyFrames>
                                                                <ColorAnimation BeginTime="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="(Path.Stroke).(SolidColorBrush.Color)" To="#FF003366"/>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                    </vsm:VisualStateGroup>
                                                    <vsm:VisualStateGroup x:Name="FocusStates">
                                                        <vsm:VisualState x:Name="Focused">
                                                            <Storyboard>
                                                                <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                                                </ObjectAnimationUsingKeyFrames>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                        <vsm:VisualState x:Name="Unfocused"/>
                                                    </vsm:VisualStateGroup>
                                                </vsm:VisualStateManager.VisualStateGroups>
                                                <Border Padding="{TemplateBinding Padding}">
                                                    <Grid Background="Transparent">
                                                        <Grid.ColumnDefinitions>
                                                            <ColumnDefinition Width="*"/>
                                                            <ColumnDefinition Width="19"/>
                                                        </Grid.ColumnDefinitions>
                                                        <Grid Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Top">
                                                            <Ellipse Fill="{StaticResource ExpanderArrowFill}" Height="19" HorizontalAlignment="Center" x:Name="circle" Stroke="DarkGray" VerticalAlignment="Center" Width="19"/>
                                                            <Path Data="M 1,1.5 L 4.5,5 L 8,1.5" HorizontalAlignment="Center" x:Name="arrow" Stroke="#666" StrokeThickness="2" VerticalAlignment="Center"/>
                                                        </Grid>
                                                        <ContentPresenter Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" HorizontalAlignment="Left" Margin="4,0,0,0" x:Name="header" VerticalAlignment="Center"/>
                                                    </Grid>
                                                </Border>
                                                <Rectangle IsHitTestVisible="false" x:Name="FocusVisualElement" Stroke="Green" StrokeDashArray="1 2" StrokeThickness="1" Visibility="Collapsed"/>
                                            </Grid>
                                        </ControlTemplate>
                                        <ControlTemplate x:Key="ExpanderUpHeaderTemplate" TargetType="ToggleButton">
                                            <Grid Background="Transparent">
                                                <vsm:VisualStateManager.VisualStateGroups>
                                                    <vsm:VisualStateGroup x:Name="CheckStates">
                                                        <vsm:VisualStateGroup.Transitions>
                                                            <vsm:VisualTransition GeneratedDuration="00:00:00"/>
                                                        </vsm:VisualStateGroup.Transitions>
                                                        <vsm:VisualState x:Name="Checked">
                                                            <Storyboard>
                                                                <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="Data">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="M 1,4.5 L 4.5,1 L 8,4.5"/>
                                                                </ObjectAnimationUsingKeyFrames>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                        <vsm:VisualState x:Name="Unchecked"/>
                                                    </vsm:VisualStateGroup>
                                                    <vsm:VisualStateGroup x:Name="CommonStates">
                                                        <vsm:VisualStateGroup.Transitions>
                                                            <vsm:VisualTransition GeneratedDuration="0"/>
                                                            <vsm:VisualTransition GeneratedDuration="00:00:00.1" To="MouseOver"/>
                                                            <vsm:VisualTransition GeneratedDuration="00:00:00.1" To="Pressed"/>
                                                        </vsm:VisualStateGroup.Transitions>
                                                        <vsm:VisualState x:Name="Normal"/>
                                                        <vsm:VisualState x:Name="MouseOver">
                                                            <Storyboard>
                                                                <ColorAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Stroke).(SolidColorBrush.Color)" To="#FF3C7FB1"/>
                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Fill)">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderArrowHoverFill}"/>
                                                                </ObjectAnimationUsingKeyFrames>
                                                                <ColorAnimation BeginTime="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="(Path.Stroke).(SolidColorBrush.Color)" To="#222"/>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                        <vsm:VisualState x:Name="Pressed">
                                                            <Storyboard>
                                                                <ColorAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Stroke).(SolidColorBrush.Color)" To="#FF526C7B"/>
                                                                <DoubleAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="StrokeThickness" To="1.5"/>
                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Fill)">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderArrowPressedFill}"/>
                                                                </ObjectAnimationUsingKeyFrames>
                                                                <ColorAnimation BeginTime="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="(Path.Stroke).(SolidColorBrush.Color)" To="#FF003366"/>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                    </vsm:VisualStateGroup>
                                                    <vsm:VisualStateGroup x:Name="FocusStates">
                                                        <vsm:VisualState x:Name="Focused">
                                                            <Storyboard>
                                                                <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                                                </ObjectAnimationUsingKeyFrames>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                        <vsm:VisualState x:Name="Unfocused"/>
                                                    </vsm:VisualStateGroup>
                                                </vsm:VisualStateManager.VisualStateGroups>
                                                <Border Padding="{TemplateBinding Padding}">
                                                    <Grid Background="Transparent">
                                                        <Grid.ColumnDefinitions>
                                                            <ColumnDefinition Width="*"/>
                                                            <ColumnDefinition Width="19"/>
                                                        </Grid.ColumnDefinitions>
                                                        <Grid Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Top">
                                                            <Grid.RenderTransform>
                                                                <TransformGroup>
                                                                    <TransformGroup.Children>
                                                                        <TransformCollection>
                                                                            <RotateTransform Angle="180" CenterX="9.5" CenterY="9.5"/>
                                                                        </TransformCollection>
                                                                    </TransformGroup.Children>
                                                                </TransformGroup>
                                                            </Grid.RenderTransform>
                                                            <Ellipse Fill="{StaticResource ExpanderArrowFill}" Height="19" HorizontalAlignment="Center" x:Name="circle" Stroke="DarkGray" VerticalAlignment="Center" Width="19"/>
                                                            <Path Data="M 1,1.5 L 4.5,5 L 8,1.5" HorizontalAlignment="Center" x:Name="arrow" Stroke="#666" StrokeThickness="2" VerticalAlignment="Center"/>
                                                        </Grid>
                                                        <ContentPresenter Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" HorizontalAlignment="Left" Margin="4,0,0,0" x:Name="header" VerticalAlignment="Center"/>
                                                    </Grid>
                                                </Border>
                                                <Rectangle IsHitTestVisible="false" x:Name="FocusVisualElement" Stroke="Green" StrokeDashArray="1 2" StrokeThickness="1" Visibility="Collapsed"/>
                                            </Grid>
                                        </ControlTemplate>
                                        <ControlTemplate x:Key="ExpanderLeftHeaderTemplate" TargetType="ToggleButton">
                                            <Grid Background="Transparent">
                                                <vsm:VisualStateManager.VisualStateGroups>
                                                    <vsm:VisualStateGroup x:Name="CheckStates">
                                                        <vsm:VisualStateGroup.Transitions>
                                                            <vsm:VisualTransition GeneratedDuration="00:00:00"/>
                                                        </vsm:VisualStateGroup.Transitions>
                                                        <vsm:VisualState x:Name="Checked">
                                                            <Storyboard>
                                                                <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="Data">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="M 1,4.5 L 4.5,1 L 8,4.5"/>
                                                                </ObjectAnimationUsingKeyFrames>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                        <vsm:VisualState x:Name="Unchecked"/>
                                                    </vsm:VisualStateGroup>
                                                    <vsm:VisualStateGroup x:Name="CommonStates">
                                                        <vsm:VisualStateGroup.Transitions>
                                                            <vsm:VisualTransition GeneratedDuration="0"/>
                                                            <vsm:VisualTransition GeneratedDuration="00:00:00.1" To="MouseOver"/>
                                                            <vsm:VisualTransition GeneratedDuration="00:00:00.1" To="Pressed"/>
                                                        </vsm:VisualStateGroup.Transitions>
                                                        <vsm:VisualState x:Name="Normal"/>
                                                        <vsm:VisualState x:Name="MouseOver">
                                                            <Storyboard>
                                                                <ColorAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Stroke).(SolidColorBrush.Color)" To="#FF3C7FB1"/>
                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Fill)">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderArrowHoverFill}"/>
                                                                </ObjectAnimationUsingKeyFrames>
                                                                <ColorAnimation BeginTime="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="(Path.Stroke).(SolidColorBrush.Color)" To="#222"/>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                        <vsm:VisualState x:Name="Pressed">
                                                            <Storyboard>
                                                                <ColorAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Stroke).(SolidColorBrush.Color)" To="#FF526C7B"/>
                                                                <DoubleAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="StrokeThickness" To="1.5"/>
                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Fill)">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderArrowPressedFill}"/>
                                                                </ObjectAnimationUsingKeyFrames>
                                                                <ColorAnimation BeginTime="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="(Path.Stroke).(SolidColorBrush.Color)" To="#FF003366"/>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                    </vsm:VisualStateGroup>
                                                    <vsm:VisualStateGroup x:Name="FocusStates">
                                                        <vsm:VisualState x:Name="Focused">
                                                            <Storyboard>
                                                                <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                                                </ObjectAnimationUsingKeyFrames>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                        <vsm:VisualState x:Name="Unfocused"/>
                                                    </vsm:VisualStateGroup>
                                                </vsm:VisualStateManager.VisualStateGroups>
                                                <Border Padding="{TemplateBinding Padding}">
                                                    <Grid Background="Transparent">
                                                        <Grid.RowDefinitions>
                                                            <RowDefinition Height="*"/>
                                                            <RowDefinition Height="19"/>
                                                        </Grid.RowDefinitions>
                                                        <Grid Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Top">
                                                            <Grid.RenderTransform>
                                                                <TransformGroup>
                                                                    <TransformGroup.Children>
                                                                        <TransformCollection>
                                                                            <RotateTransform Angle="90" CenterX="9.5" CenterY="9.5"/>
                                                                        </TransformCollection>
                                                                    </TransformGroup.Children>
                                                                </TransformGroup>
                                                            </Grid.RenderTransform>
                                                            <Ellipse Fill="{StaticResource ExpanderArrowFill}" Height="19" HorizontalAlignment="Center" x:Name="circle" Width="19" Stroke="DarkGray" VerticalAlignment="Center"/>
                                                            <Path Data="M 1,1.5 L 4.5,5 L 8,1.5" HorizontalAlignment="Center" x:Name="arrow" Stroke="#666" StrokeThickness="2" VerticalAlignment="Center"/>
                                                        </Grid>
                                                        <ContentPresenter Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" HorizontalAlignment="Center" Margin="0,4,0,0" x:Name="header" VerticalAlignment="Top"/>
                                                    </Grid>
                                                </Border>
                                                <Rectangle IsHitTestVisible="false" x:Name="FocusVisualElement" Stroke="Green" StrokeDashArray="1 2" StrokeThickness="1" Visibility="Collapsed"/>
                                            </Grid>
                                        </ControlTemplate>
                                        <ControlTemplate x:Key="ExpanderRightHeaderTemplate" TargetType="ToggleButton">
                                            <Grid Background="Transparent">
                                                <vsm:VisualStateManager.VisualStateGroups>
                                                    <vsm:VisualStateGroup x:Name="CheckStates">
                                                        <vsm:VisualStateGroup.Transitions>
                                                            <vsm:VisualTransition GeneratedDuration="00:00:00"/>
                                                        </vsm:VisualStateGroup.Transitions>
                                                        <vsm:VisualState x:Name="Checked">
                                                            <Storyboard>
                                                                <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="Data">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="M 1,4.5 L 4.5,1 L 8,4.5"/>
                                                                </ObjectAnimationUsingKeyFrames>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                        <vsm:VisualState x:Name="Unchecked"/>
                                                    </vsm:VisualStateGroup>
                                                    <vsm:VisualStateGroup x:Name="CommonStates">
                                                        <vsm:VisualStateGroup.Transitions>
                                                            <vsm:VisualTransition GeneratedDuration="0"/>
                                                            <vsm:VisualTransition GeneratedDuration="00:00:00.1" To="MouseOver"/>
                                                            <vsm:VisualTransition GeneratedDuration="00:00:00.1" To="Pressed"/>
                                                        </vsm:VisualStateGroup.Transitions>
                                                        <vsm:VisualState x:Name="Normal"/>
                                                        <vsm:VisualState x:Name="MouseOver">
                                                            <Storyboard>
                                                                <ColorAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Stroke).(SolidColorBrush.Color)" To="#FF3C7FB1"/>
                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Fill)">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderArrowHoverFill}"/>
                                                                </ObjectAnimationUsingKeyFrames>
                                                                <ColorAnimation BeginTime="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="(Path.Stroke).(SolidColorBrush.Color)" To="#222"/>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                        <vsm:VisualState x:Name="Pressed">
                                                            <Storyboard>
                                                                <ColorAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Stroke).(SolidColorBrush.Color)" To="#FF526C7B"/>
                                                                <DoubleAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="StrokeThickness" To="1.5"/>
                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Fill)">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderArrowPressedFill}"/>
                                                                </ObjectAnimationUsingKeyFrames>
                                                                <ColorAnimation BeginTime="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="(Path.Stroke).(SolidColorBrush.Color)" To="#FF003366"/>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                    </vsm:VisualStateGroup>
                                                    <vsm:VisualStateGroup x:Name="FocusStates">
                                                        <vsm:VisualState x:Name="Focused">
                                                            <Storyboard>
                                                                <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                                                </ObjectAnimationUsingKeyFrames>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                        <vsm:VisualState x:Name="Unfocused"/>
                                                    </vsm:VisualStateGroup>
                                                </vsm:VisualStateManager.VisualStateGroups>
                                                <Border Padding="{TemplateBinding Padding}">
                                                    <Grid Background="Transparent">
                                                        <Grid.RowDefinitions>
                                                            <RowDefinition Height="*"/>
                                                            <RowDefinition Height="19"/>
                                                        </Grid.RowDefinitions>
                                                        <Grid Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Top">
                                                            <Grid.RenderTransform>
                                                                <TransformGroup>
                                                                    <TransformGroup.Children>
                                                                        <TransformCollection>
                                                                            <RotateTransform Angle="270" CenterX="9.5" CenterY="9.5"/>
                                                                        </TransformCollection>
                                                                    </TransformGroup.Children>
                                                                </TransformGroup>
                                                            </Grid.RenderTransform>
                                                            <Ellipse Fill="{StaticResource ExpanderArrowFill}" Height="19" HorizontalAlignment="Center" x:Name="circle" Stroke="DarkGray" VerticalAlignment="Center" Width="19"/>
                                                            <Path Data="M 1,1.5 L 4.5,5 L 8,1.5" HorizontalAlignment="Center" x:Name="arrow" Stroke="#666" StrokeThickness="2" VerticalAlignment="Center"/>
                                                        </Grid>
                                                        <ContentPresenter Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" HorizontalAlignment="Center" Margin="0,4,0,0" x:Name="header" VerticalAlignment="Top"/>
                                                    </Grid>
                                                </Border>
                                                <Rectangle IsHitTestVisible="false" x:Name="FocusVisualElement" Stroke="Green" StrokeDashArray="1 2" StrokeThickness="1" Visibility="Collapsed"/>
                                            </Grid>
                                        </ControlTemplate>
                                    </Grid.Resources>
                                    <vsm:VisualStateManager.VisualStateGroups>
                                        <vsm:VisualStateGroup x:Name="CommonStates">
                                            <vsm:VisualStateGroup.Transitions>
                                                <vsm:VisualTransition GeneratedDuration="0"/>
                                            </vsm:VisualStateGroup.Transitions>
                                            <vsm:VisualState x:Name="Normal"/>
                                            <vsm:VisualState x:Name="Disabled">
                                                <Storyboard>
                                                    <DoubleAnimation Duration="0" Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="(UIElement.Opacity)" To="1"/>
                                                </Storyboard>
                                            </vsm:VisualState>
                                        </vsm:VisualStateGroup>
                                        <vsm:VisualStateGroup x:Name="FocusStates">
                                            <vsm:VisualState x:Name="Focused">
                                                <Storyboard>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </vsm:VisualState>
                                            <vsm:VisualState x:Name="Unfocused"/>
                                        </vsm:VisualStateGroup>
                                        <vsm:VisualStateGroup x:Name="ExpansionStates">
                                            <vsm:VisualStateGroup.Transitions>
                                                <vsm:VisualTransition GeneratedDuration="0"/>
                                            </vsm:VisualStateGroup.Transitions>
                                            <vsm:VisualState x:Name="Collapsed"/>
                                            <vsm:VisualState x:Name="Expanded">
                                                <Storyboard>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="Visibility">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </vsm:VisualState>
                                        </vsm:VisualStateGroup>
                                        <vsm:VisualStateGroup x:Name="ExpandDirectionStates">
                                            <vsm:VisualStateGroup.Transitions>
                                                <vsm:VisualTransition GeneratedDuration="0"/>
                                            </vsm:VisualStateGroup.Transitions>
                                            <vsm:VisualState x:Name="ExpandDown">
                                                <Storyboard>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="rd1" Storyboard.TargetProperty="Height">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="cd0" Storyboard.TargetProperty="Width">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </vsm:VisualState>
                                            <vsm:VisualState x:Name="ExpandUp">
                                                <Storyboard>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="Template">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderUpHeaderTemplate}"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="(Grid.Row)">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="1"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(Grid.Row)">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="0"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="rd0" Storyboard.TargetProperty="Height">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="cd0" Storyboard.TargetProperty="Width">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </vsm:VisualState>
                                            <vsm:VisualState x:Name="ExpandLeft">
                                                <Storyboard>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="Template">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderLeftHeaderTemplate}"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="(Grid.Column)">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="1"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(Grid.Row)">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="0"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="rd0" Storyboard.TargetProperty="Height">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="cd0" Storyboard.TargetProperty="Width">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </vsm:VisualState>
                                            <vsm:VisualState x:Name="ExpandRight">
                                                <Storyboard>
                                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="Template">
                                                        <DiscreteObjectKeyFrame KeyTime="00:00:00.1000000" Value="{StaticResource ExpanderLeftHeaderTemplate}"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(Grid.Row)">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="0"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(Grid.Column)">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="1"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="rd0" Storyboard.TargetProperty="Height">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="cd1" Storyboard.TargetProperty="Width">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </vsm:VisualState>
                                        </vsm:VisualStateGroup>
                                    </vsm:VisualStateManager.VisualStateGroups>
                                    <Border x:Name="Background" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3">
                                        <Grid>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="Auto" x:Name="rd0"/>
                                                <RowDefinition Height="Auto" x:Name="rd1"/>
                                            </Grid.RowDefinitions>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="Auto" x:Name="cd0"/>
                                                <ColumnDefinition Width="Auto" x:Name="cd1"/>
                                            </Grid.ColumnDefinitions>
                                            <ToggleButton Content="{TemplateBinding Header}" ContentTemplate="{TemplateBinding HeaderTemplate}" FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}" FontStretch="{TemplateBinding FontStretch}" FontStyle="{TemplateBinding FontStyle}" FontWeight="{TemplateBinding FontWeight}" Foreground="{TemplateBinding Foreground}" Grid.Column="0" Grid.Row="0" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" IsChecked="{TemplateBinding IsExpanded}" Margin="1" MinHeight="0" MinWidth="0" x:Name="ExpanderButton" Padding="{TemplateBinding Padding}" Template="{StaticResource ExpanderDownHeaderTemplate}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
                                            <ContentControl Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}" FontStretch="{TemplateBinding FontStretch}" FontStyle="{TemplateBinding FontStyle}" FontWeight="{TemplateBinding FontWeight}" Foreground="{TemplateBinding Foreground}" Grid.Column="0" Grid.Row="1" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" x:Name="ExpandSite" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" Visibility="Collapsed"/>
                                        </Grid>
                                    </Border>
                                    <Border x:Name="DisabledVisualElement" IsHitTestVisible="false" Opacity="0" Background="#A5FFFFFF" CornerRadius="3"/>
                                    <Border x:Name="FocusVisualElement" IsHitTestVisible="false" Visibility="Collapsed" BorderThickness="1" CornerRadius="3">
                                        <Border.BorderBrush>
                                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                <GradientStop Color="#FFA3AEB9"/>
                                                <GradientStop Color="#FF8399A9" Offset="0.375"/>
                                                <GradientStop Color="#FF718597" Offset="0.375"/>
                                                <GradientStop Color="#FF617584" Offset="1"/>
                                            </LinearGradientBrush>
                                        </Border.BorderBrush>
                                    </Border>
                                </Grid>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </Grid.Resources>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="150" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="150" />
                <ColumnDefinition Width="150" />
                <ColumnDefinition Width="150" />
                <ColumnDefinition Width="150" />
                <ColumnDefinition Width="150" />
            </Grid.ColumnDefinitions>

            <TextBlock Grid.Row="0" Grid.Column="0" Style="{StaticResource Description}" Text="ExpandDirection"/>
            <TextBlock Grid.Row="0" Grid.Column="1" Style="{StaticResource Description}" Text="No Button"/>
            <TextBlock Grid.Row="0" Grid.Column="2" Style="{StaticResource Description}" Text="Button Right/Bottom" />
            <TextBlock Grid.Row="0" Grid.Column="3" Style="{StaticResource Description}" Text="Fade In/Out"/>
            <TextBlock Grid.Row="0" Grid.Column="4" Style="{StaticResource Description}" Text="Scale In/Out" />

            <ListBox x:Name="lbCustDirection" Grid.Row="1" Grid.Column="0" HorizontalAlignment="Left">
                <ListBoxItem Content="Down" IsSelected="True"/>
                <ListBoxItem Content="Up" />
                <ListBoxItem Content="Left" />
                <ListBoxItem Content="Right" />
            </ListBox>
            <toolkit:Expander x:Name="expNoButton" Content="Content" Header="Header" 
                               Grid.Row="1" Grid.Column="1" Margin="5" Style="{StaticResource ExpanderNoButtonStyle}">
            </toolkit:Expander>
            <toolkit:Expander x:Name="expBRButton" Grid.Row="1" Grid.Column="2" Margin="5" Style="{StaticResource ExpanderBottomRightButtonStyle}">
                <toolkit:Expander.Content>
                    <Button Content="&lt;Button&gt;"></Button>
                </toolkit:Expander.Content>
            </toolkit:Expander>
            <toolkit:Expander x:Name="expFade" Content="Content" Header="&lt;HeaderTemplate&gt;" 
                               Grid.Row="1" Grid.Column="3" Margin="5" Style="{StaticResource ExpanderFadeStyle}">
                <toolkit:Expander.HeaderTemplate>
                    <DataTemplate>
                        <Button Content="{Binding}" Style="{StaticResource DemoButton}"></Button>
                    </DataTemplate>
                </toolkit:Expander.HeaderTemplate>
            </toolkit:Expander>
            <toolkit:Expander x:Name="expScale" Header="&lt;HeaderTemplate&gt;" Content="&lt;ContentTemplate&gt;"
                               Grid.Row="1" Grid.Column="4" Margin="5" Style="{StaticResource ExpanderScaleStyle}">
                <toolkit:Expander.HeaderTemplate>
                    <DataTemplate>
                        <TextBlock Text="{Binding}" Foreground="Blue"/>
                    </DataTemplate>
                </toolkit:Expander.HeaderTemplate>
                <toolkit:Expander.ContentTemplate>
                    <DataTemplate>
                        <Button Content="{Binding}" Style="{StaticResource DemoButton}"></Button>
                    </DataTemplate>
                </toolkit:Expander.ContentTemplate>
            </toolkit:Expander>
        </Grid>
        
        <!-- Interactive Usage -->
        <ContentControl Content="Interactive Usage" Style="{StaticResource Header}" />
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="200" />
                <ColumnDefinition Width="10" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <Grid>
                <StackPanel>
                    <Button Content="Button1"/>
                    <toolkit:Expander x:Name="expander" Style="{StaticResource DemoExpander}"/>
                    <Button Content="Button2"/>
                    <TextBlock x:Name="output" />
                </StackPanel>
            </Grid>
            <Grid Grid.Column="2">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="100" />
                    <ColumnDefinition Width="5" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                
                <TextBlock Text="ExpandDirection:" Grid.Row="0" Grid.Column="0" />
                <ListBox x:Name="lbExpandDirection" Grid.Row="0" Grid.Column="2" HorizontalAlignment="Left">
                    <ListBoxItem Content="Down" IsSelected="True"/>
                    <ListBoxItem Content="Up" />
                    <ListBoxItem Content="Left" />
                    <ListBoxItem Content="Right" />
                </ListBox>
                
                <TextBlock Text="Header:" Grid.Row="1" Grid.Column="0" />
                <TextBox x:Name="tbHeader" Grid.Row="1" Grid.Column="2" />
                
                <TextBlock Text="HeaderTemplate:" Grid.Row="2" Grid.Column="0" />
                <TextBox x:Name="tbHeaderTemplate" Grid.Row="2" Grid.Column="2" />
                
                <TextBlock Text="Content:" Grid.Row="3" Grid.Column="0" />
                <TextBox x:Name="tbContent" Grid.Row="3" Grid.Column="2" />
                
                <TextBlock Text="ContentTemplate:" Grid.Row="4" Grid.Column="0" />
                <TextBox x:Name="tbContentTemplate" Grid.Row="4" Grid.Column="2" />

                <CheckBox x:Name="cbIsEnabled" Grid.Row="5" Grid.Column="2"
                          HorizontalAlignment="Left" Content="IsEnabled" IsChecked="true" />

                <Button x:Name="btnChange" Grid.Row="6" Grid.Column="2"
                        HorizontalAlignment="Left" Content="Change!"/>
            </Grid>
        </Grid>
            <src:SourceViewer xmlns:src="clr-namespace:System.Windows.Controls.Samples;assembly=System.Windows.Controls.Samples.Common" xmlns:sys="clr-namespace:System;assembly=mscorlib">
  <src:SourceFile Path="ExpanderSample.xaml">
    <src:SourceFile.Source>
      <sys:String>&lt;!--
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Public License (Ms-PL).
// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
// All other rights reserved.
--&gt;

&lt;UserControl
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:toolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"
xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows"
  
  x:Class="System.Windows.Controls.Samples.ExpanderSample"&gt;
    &lt;StackPanel&gt;
        &lt;StackPanel.Resources&gt;
            &lt;Style x:Key="DemoButton" TargetType="Button"&gt;
                &lt;Setter Property="Margin" Value="2" /&gt;
                &lt;Setter Property="Foreground" Value="Blue" /&gt;
                &lt;Setter Property="Content" Value="Content From Style" /&gt;
            &lt;/Style&gt;
            &lt;Style x:Key="DemoExpander" TargetType="toolkit:Expander"&gt;
                &lt;Setter Property="Header" Value="Header" /&gt;
                &lt;Setter Property="Content" Value="Content" /&gt;
                &lt;Setter Property="Margin" Value="5"/&gt;
            &lt;/Style&gt;
        &lt;/StackPanel.Resources&gt;

        &lt;!-- ExpandDirection table --&gt;
        &lt;ContentControl Content="ExpandDirection" Style="{StaticResource Header}" /&gt;
        &lt;Grid&gt;
            &lt;Grid.RowDefinitions&gt;
                &lt;RowDefinition Height="Auto" /&gt;
                &lt;RowDefinition Height="150" /&gt;
            &lt;/Grid.RowDefinitions&gt;
            &lt;Grid.ColumnDefinitions&gt;
                &lt;ColumnDefinition Width="150" /&gt;
                &lt;ColumnDefinition Width="150" /&gt;
                &lt;ColumnDefinition Width="150" /&gt;
                &lt;ColumnDefinition Width="150" /&gt;
            &lt;/Grid.ColumnDefinitions&gt;
            
            &lt;TextBlock Grid.Row="0" Grid.Column="0" Style="{StaticResource Description}" Text="ExpandDirection.Down"  FontWeight="Bold"/&gt;
            &lt;TextBlock Grid.Row="0" Grid.Column="1" Style="{StaticResource Description}" Text="ExpandDirection.Up" /&gt;
            &lt;TextBlock Grid.Row="0" Grid.Column="2" Style="{StaticResource Description}" Text="ExpandDirection.Left"/&gt;
            &lt;TextBlock Grid.Row="0" Grid.Column="3" Style="{StaticResource Description}" Text="ExpandDirection.Right" /&gt;
            
            &lt;toolkit:Expander Grid.Row="1" Grid.Column="0" ExpandDirection="Down" Style="{StaticResource DemoExpander}"&gt;
            &lt;/toolkit:Expander&gt;
            &lt;toolkit:Expander Grid.Row="1" Grid.Column="1" ExpandDirection="Up" Style="{StaticResource DemoExpander}"&gt;
                &lt;toolkit:Expander.Content&gt;
                    &lt;Button Content="&amp;lt;Button&amp;gt;"&gt;&lt;/Button&gt;
                &lt;/toolkit:Expander.Content&gt;
            &lt;/toolkit:Expander&gt;
            &lt;toolkit:Expander Grid.Row="1" Grid.Column="2" ExpandDirection="Left" Style="{StaticResource DemoExpander}"
                               Header="&amp;lt;HeaderTemplate&amp;gt;"&gt;
                &lt;toolkit:Expander.HeaderTemplate&gt;
                    &lt;DataTemplate&gt;
                        &lt;Button Content="{Binding}" Style="{StaticResource DemoButton}"&gt;&lt;/Button&gt;
                    &lt;/DataTemplate&gt;
                &lt;/toolkit:Expander.HeaderTemplate&gt;
            &lt;/toolkit:Expander&gt;
            &lt;toolkit:Expander Grid.Row="1" Grid.Column="3" ExpandDirection="Right" Style="{StaticResource DemoExpander}"
                               Header="&amp;lt;HeaderTemplate&amp;gt;" Content="&amp;lt;ContentTemplate&amp;gt;"&gt;
                &lt;toolkit:Expander.HeaderTemplate&gt;
                    &lt;DataTemplate&gt;
                        &lt;TextBlock Text="{Binding}" Foreground="Blue"/&gt;
                    &lt;/DataTemplate&gt;
                &lt;/toolkit:Expander.HeaderTemplate&gt;
                &lt;toolkit:Expander.ContentTemplate&gt;
                    &lt;DataTemplate&gt;
                        &lt;Button Content="{Binding}" Style="{StaticResource DemoButton}"&gt;&lt;/Button&gt;
                    &lt;/DataTemplate&gt;
                &lt;/toolkit:Expander.ContentTemplate&gt;
            &lt;/toolkit:Expander&gt;
        &lt;/Grid&gt;

        &lt;!-- Customization --&gt;
        &lt;ContentControl Content="Customization" Style="{StaticResource Header}" /&gt;
        &lt;Grid&gt;
            &lt;Grid.Resources&gt;
                &lt;Style x:Key="ExpanderFadeStyle" TargetType="toolkit:Expander"&gt;
                    &lt;Setter Property="Background" Value="Transparent"/&gt;
                    &lt;Setter Property="BorderBrush" Value="Transparent"/&gt;
                    &lt;Setter Property="BorderThickness" Value="1"/&gt;
                    &lt;Setter Property="HorizontalContentAlignment" Value="Stretch"/&gt;
                    &lt;Setter Property="VerticalContentAlignment" Value="Stretch"/&gt;
                    &lt;Setter Property="Template"&gt;
                        &lt;Setter.Value&gt;
                            &lt;ControlTemplate TargetType="toolkit:Expander"&gt;
                                &lt;Grid Background="Transparent"&gt;
                                    &lt;Grid.Resources&gt;
                                        &lt;LinearGradientBrush x:Key="ExpanderArrowFill" EndPoint="0,1" StartPoint="0,0"&gt;
                                            &lt;GradientStop Color="White" Offset="0"/&gt;
                                            &lt;GradientStop Color="#FFBFBFBF" Offset="0.5"/&gt;
                                            &lt;GradientStop Color="#FF878787" Offset="1"/&gt;
                                        &lt;/LinearGradientBrush&gt;
                                        &lt;LinearGradientBrush x:Key="ExpanderArrowHoverFill" EndPoint="0,1" StartPoint="0,0"&gt;
                                            &lt;GradientStop Color="#FFF0F8FE" Offset="0"/&gt;
                                            &lt;GradientStop Color="#FFE0F3FE" Offset="0.3"/&gt;
                                            &lt;GradientStop Color="#FF6FA7C5" Offset="1"/&gt;
                                        &lt;/LinearGradientBrush&gt;
                                        &lt;LinearGradientBrush x:Key="ExpanderArrowPressedFill" EndPoint="0,1" StartPoint="0,0"&gt;
                                            &lt;GradientStop Color="#FFDCF0FA" Offset="0"/&gt;
                                            &lt;GradientStop Color="#FFC5E6F7" Offset="0.2"/&gt;
                                            &lt;GradientStop Color="#FF5690D0" Offset="1"/&gt;
                                        &lt;/LinearGradientBrush&gt;
                                        &lt;ControlTemplate x:Key="ExpanderDownHeaderTemplate" TargetType="ToggleButton"&gt;
                                            &lt;Grid Background="Transparent"&gt;
                                                &lt;vsm:VisualStateManager.VisualStateGroups&gt;
                                                    &lt;vsm:VisualStateGroup x:Name="CheckStates"&gt;
                                                        &lt;vsm:VisualStateGroup.Transitions&gt;
                                                            &lt;vsm:VisualTransition GeneratedDuration="00:00:00"/&gt;
                                                        &lt;/vsm:VisualStateGroup.Transitions&gt;
                                                        &lt;vsm:VisualState x:Name="Checked"&gt;
                                                            &lt;Storyboard&gt;
                                                                &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="Data"&gt;
                                                                    &lt;DiscreteObjectKeyFrame KeyTime="0" Value="M 1,4.5 L 4.5,1 L 8,4.5"/&gt;
                                                                &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                            &lt;/Storyboard&gt;
                                                        &lt;/vsm:VisualState&gt;
                                                        &lt;vsm:VisualState x:Name="Unchecked"/&gt;
                                                    &lt;/vsm:VisualStateGroup&gt;
                                                    &lt;vsm:VisualStateGroup x:Name="CommonStates"&gt;
                                                        &lt;vsm:VisualStateGroup.Transitions&gt;
                                                            &lt;vsm:VisualTransition GeneratedDuration="0"/&gt;
                                                            &lt;vsm:VisualTransition GeneratedDuration="00:00:00.1" To="MouseOver"/&gt;
                                                            &lt;vsm:VisualTransition GeneratedDuration="00:00:00.1" To="Pressed"/&gt;
                                                        &lt;/vsm:VisualStateGroup.Transitions&gt;
                                                        &lt;vsm:VisualState x:Name="Normal"/&gt;
                                                        &lt;vsm:VisualState x:Name="MouseOver"&gt;
                                                            &lt;Storyboard&gt;
                                                                &lt;ColorAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Stroke).(SolidColorBrush.Color)" To="#FF3C7FB1"/&gt;
                                                                &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Fill)"&gt;
                                                                    &lt;DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderArrowHoverFill}"/&gt;
                                                                &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                                &lt;ColorAnimation BeginTime="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="(Path.Stroke).(SolidColorBrush.Color)" To="#222"/&gt;
                                                            &lt;/Storyboard&gt;
                                                        &lt;/vsm:VisualState&gt;
                                                        &lt;vsm:VisualState x:Name="Pressed"&gt;
                                                            &lt;Storyboard&gt;
                                                                &lt;ColorAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Stroke).(SolidColorBrush.Color)" To="#FF526C7B"/&gt;
                                                                &lt;DoubleAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="StrokeThickness" To="1.5"/&gt;
                                                                &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Fill)"&gt;
                                                                    &lt;DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderArrowPressedFill}"/&gt;
                                                                &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                                &lt;ColorAnimation BeginTime="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="(Path.Stroke).(SolidColorBrush.Color)" To="#FF003366"/&gt;
                                                            &lt;/Storyboard&gt;
                                                        &lt;/vsm:VisualState&gt;
                                                    &lt;/vsm:VisualStateGroup&gt;
                                                    &lt;vsm:VisualStateGroup x:Name="FocusStates"&gt;
                                                        &lt;vsm:VisualState x:Name="Focused"&gt;
                                                            &lt;Storyboard&gt;
                                                                &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility"&gt;
                                                                    &lt;DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/&gt;
                                                                &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                            &lt;/Storyboard&gt;
                                                        &lt;/vsm:VisualState&gt;
                                                        &lt;vsm:VisualState x:Name="Unfocused"/&gt;
                                                    &lt;/vsm:VisualStateGroup&gt;
                                                &lt;/vsm:VisualStateManager.VisualStateGroups&gt;
                                                &lt;Border Padding="{TemplateBinding Padding}"&gt;
                                                    &lt;Grid Background="Transparent"&gt;
                                                        &lt;Grid.ColumnDefinitions&gt;
                                                            &lt;ColumnDefinition Width="19"/&gt;
                                                            &lt;ColumnDefinition Width="*"/&gt;
                                                        &lt;/Grid.ColumnDefinitions&gt;
                                                        &lt;Grid HorizontalAlignment="Left" VerticalAlignment="Top"&gt;
                                                            &lt;Ellipse Fill="{StaticResource ExpanderArrowFill}" Height="19" HorizontalAlignment="Center" x:Name="circle" Stroke="DarkGray" VerticalAlignment="Center" Width="19"/&gt;
                                                            &lt;Path Data="M 1,1.5 L 4.5,5 L 8,1.5" HorizontalAlignment="Center" x:Name="arrow" Stroke="#666" StrokeThickness="2" VerticalAlignment="Center"/&gt;
                                                        &lt;/Grid&gt;
                                                        &lt;ContentPresenter Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" Grid.Column="1" HorizontalAlignment="Left" Margin="4,0,0,0" x:Name="header" VerticalAlignment="Center"/&gt;
                                                    &lt;/Grid&gt;
                                                &lt;/Border&gt;
                                                &lt;Rectangle IsHitTestVisible="false" x:Name="FocusVisualElement" Stroke="Green" StrokeDashArray="1 2" StrokeThickness="1" Visibility="Collapsed"/&gt;
                                            &lt;/Grid&gt;
                                        &lt;/ControlTemplate&gt;
                                        &lt;ControlTemplate x:Key="ExpanderUpHeaderTemplate" TargetType="ToggleButton"&gt;
                                            &lt;Grid Background="Transparent"&gt;
                                                &lt;vsm:VisualStateManager.VisualStateGroups&gt;
                                                    &lt;vsm:VisualStateGroup x:Name="CheckStates"&gt;
                                                        &lt;vsm:VisualStateGroup.Transitions&gt;
                                                            &lt;vsm:VisualTransition GeneratedDuration="00:00:00"/&gt;
                                                        &lt;/vsm:VisualStateGroup.Transitions&gt;
                                                        &lt;vsm:VisualState x:Name="Checked"&gt;
                                                            &lt;Storyboard&gt;
                                                                &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="Data"&gt;
                                                                    &lt;DiscreteObjectKeyFrame KeyTime="0" Value="M 1,4.5 L 4.5,1 L 8,4.5"/&gt;
                                                                &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                            &lt;/Storyboard&gt;
                                                        &lt;/vsm:VisualState&gt;
                                                        &lt;vsm:VisualState x:Name="Unchecked"/&gt;
                                                    &lt;/vsm:VisualStateGroup&gt;
                                                    &lt;vsm:VisualStateGroup x:Name="CommonStates"&gt;
                                                        &lt;vsm:VisualStateGroup.Transitions&gt;
                                                            &lt;vsm:VisualTransition GeneratedDuration="0"/&gt;
                                                            &lt;vsm:VisualTransition GeneratedDuration="00:00:00.1" To="MouseOver"/&gt;
                                                            &lt;vsm:VisualTransition GeneratedDuration="00:00:00.1" To="Pressed"/&gt;
                                                        &lt;/vsm:VisualStateGroup.Transitions&gt;
                                                        &lt;vsm:VisualState x:Name="Normal"/&gt;
                                                        &lt;vsm:VisualState x:Name="MouseOver"&gt;
                                                            &lt;Storyboard&gt;
                                                                &lt;ColorAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Stroke).(SolidColorBrush.Color)" To="#FF3C7FB1"/&gt;
                                                                &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Fill)"&gt;
                                                                    &lt;DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderArrowHoverFill}"/&gt;
                                                                &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                                &lt;ColorAnimation BeginTime="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="(Path.Stroke).(SolidColorBrush.Color)" To="#222"/&gt;
                                                            &lt;/Storyboard&gt;
                                                        &lt;/vsm:VisualState&gt;
                                                        &lt;vsm:VisualState x:Name="Pressed"&gt;
                                                            &lt;Storyboard&gt;
                                                                &lt;ColorAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Stroke).(SolidColorBrush.Color)" To="#FF526C7B"/&gt;
                                                                &lt;DoubleAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="StrokeThickness" To="1.5"/&gt;
                                                                &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Fill)"&gt;
                                                                    &lt;DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderArrowPressedFill}"/&gt;
                                                                &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                                &lt;ColorAnimation BeginTime="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="(Path.Stroke).(SolidColorBrush.Color)" To="#FF003366"/&gt;
                                                            &lt;/Storyboard&gt;
                                                        &lt;/vsm:VisualState&gt;
                                                    &lt;/vsm:VisualStateGroup&gt;
                                                    &lt;vsm:VisualStateGroup x:Name="FocusStates"&gt;
                                                        &lt;vsm:VisualState x:Name="Focused"&gt;
                                                            &lt;Storyboard&gt;
                                                                &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility"&gt;
                                                                    &lt;DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/&gt;
                                                                &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                            &lt;/Storyboard&gt;
                                                        &lt;/vsm:VisualState&gt;
                                                        &lt;vsm:VisualState x:Name="Unfocused"/&gt;
                                                    &lt;/vsm:VisualStateGroup&gt;
                                                &lt;/vsm:VisualStateManager.VisualStateGroups&gt;
                                                &lt;Border Padding="{TemplateBinding Padding}"&gt;
                                                    &lt;Grid Background="Transparent"&gt;
                                                        &lt;Grid.ColumnDefinitions&gt;
                                                            &lt;ColumnDefinition Width="19"/&gt;
                                                            &lt;ColumnDefinition Width="*"/&gt;
                                                        &lt;/Grid.ColumnDefinitions&gt;
                                                        &lt;Grid HorizontalAlignment="Left" VerticalAlignment="Top"&gt;
                                                            &lt;Grid.RenderTransform&gt;
                                                                &lt;TransformGroup&gt;
                                                                    &lt;TransformGroup.Children&gt;
                                                                        &lt;TransformCollection&gt;
                                                                            &lt;RotateTransform Angle="180" CenterX="9.5" CenterY="9.5"/&gt;
                                                                        &lt;/TransformCollection&gt;
                                                                    &lt;/TransformGroup.Children&gt;
                                                                &lt;/TransformGroup&gt;
                                                            &lt;/Grid.RenderTransform&gt;
                                                            &lt;Ellipse Fill="{StaticResource ExpanderArrowFill}" Height="19" HorizontalAlignment="Center" x:Name="circle" Stroke="DarkGray" VerticalAlignment="Center" Width="19"/&gt;
                                                            &lt;Path Data="M 1,1.5 L 4.5,5 L 8,1.5" HorizontalAlignment="Center" x:Name="arrow" Stroke="#666" StrokeThickness="2" VerticalAlignment="Center"/&gt;
                                                        &lt;/Grid&gt;
                                                        &lt;ContentPresenter Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" Grid.Column="1" HorizontalAlignment="Left" Margin="4,0,0,0" x:Name="header" VerticalAlignment="Center"/&gt;
                                                    &lt;/Grid&gt;
                                                &lt;/Border&gt;
                                                &lt;Rectangle IsHitTestVisible="false" x:Name="FocusVisualElement" Stroke="Green" StrokeDashArray="1 2" StrokeThickness="1" Visibility="Collapsed"/&gt;
                                            &lt;/Grid&gt;
                                        &lt;/ControlTemplate&gt;
                                        &lt;ControlTemplate x:Key="ExpanderLeftHeaderTemplate" TargetType="ToggleButton"&gt;
                                            &lt;Grid Background="Transparent"&gt;
                                                &lt;vsm:VisualStateManager.VisualStateGroups&gt;
                                                    &lt;vsm:VisualStateGroup x:Name="CheckStates"&gt;
                                                        &lt;vsm:VisualStateGroup.Transitions&gt;
                                                            &lt;vsm:VisualTransition GeneratedDuration="00:00:00"/&gt;
                                                        &lt;/vsm:VisualStateGroup.Transitions&gt;
                                                        &lt;vsm:VisualState x:Name="Checked"&gt;
                                                            &lt;Storyboard&gt;
                                                                &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="Data"&gt;
                                                                    &lt;DiscreteObjectKeyFrame KeyTime="0" Value="M 1,4.5 L 4.5,1 L 8,4.5"/&gt;
                                                                &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                            &lt;/Storyboard&gt;
                                                        &lt;/vsm:VisualState&gt;
                                                        &lt;vsm:VisualState x:Name="Unchecked"/&gt;
                                                    &lt;/vsm:VisualStateGroup&gt;
                                                    &lt;vsm:VisualStateGroup x:Name="CommonStates"&gt;
                                                        &lt;vsm:VisualStateGroup.Transitions&gt;
                                                            &lt;vsm:VisualTransition GeneratedDuration="0"/&gt;
                                                            &lt;vsm:VisualTransition GeneratedDuration="00:00:00.1" To="MouseOver"/&gt;
                                                            &lt;vsm:VisualTransition GeneratedDuration="00:00:00.1" To="Pressed"/&gt;
                                                        &lt;/vsm:VisualStateGroup.Transitions&gt;
                                                        &lt;vsm:VisualState x:Name="Normal"/&gt;
                                                        &lt;vsm:VisualState x:Name="MouseOver"&gt;
                                                            &lt;Storyboard&gt;
                                                                &lt;ColorAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Stroke).(SolidColorBrush.Color)" To="#FF3C7FB1"/&gt;
                                                                &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Fill)"&gt;
                                                                    &lt;DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderArrowHoverFill}"/&gt;
                                                                &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                                &lt;ColorAnimation BeginTime="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="(Path.Stroke).(SolidColorBrush.Color)" To="#222"/&gt;
                                                            &lt;/Storyboard&gt;
                                                        &lt;/vsm:VisualState&gt;
                                                        &lt;vsm:VisualState x:Name="Pressed"&gt;
                                                            &lt;Storyboard&gt;
                                                                &lt;ColorAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Stroke).(SolidColorBrush.Color)" To="#FF526C7B"/&gt;
                                                                &lt;DoubleAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="StrokeThickness" To="1.5"/&gt;
                                                                &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Fill)"&gt;
                                                                    &lt;DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderArrowPressedFill}"/&gt;
                                                                &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                                &lt;ColorAnimation BeginTime="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="(Path.Stroke).(SolidColorBrush.Color)" To="#FF003366"/&gt;
                                                            &lt;/Storyboard&gt;
                                                        &lt;/vsm:VisualState&gt;
                                                    &lt;/vsm:VisualStateGroup&gt;
                                                    &lt;vsm:VisualStateGroup x:Name="FocusStates"&gt;
                                                        &lt;vsm:VisualState x:Name="Focused"&gt;
                                                            &lt;Storyboard&gt;
                                                                &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility"&gt;
                                                                    &lt;DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/&gt;
                                                                &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                            &lt;/Storyboard&gt;
                                                        &lt;/vsm:VisualState&gt;
                                                        &lt;vsm:VisualState x:Name="Unfocused"/&gt;
                                                    &lt;/vsm:VisualStateGroup&gt;
                                                &lt;/vsm:VisualStateManager.VisualStateGroups&gt;
                                                &lt;Border Padding="{TemplateBinding Padding}"&gt;
                                                    &lt;Grid Background="Transparent"&gt;
                                                        &lt;Grid.RowDefinitions&gt;
                                                            &lt;RowDefinition Height="19"/&gt;
                                                            &lt;RowDefinition Height="*"/&gt;
                                                        &lt;/Grid.RowDefinitions&gt;
                                                        &lt;Grid HorizontalAlignment="Center" VerticalAlignment="Top"&gt;
                                                            &lt;Grid.RenderTransform&gt;
                                                                &lt;TransformGroup&gt;
                                                                    &lt;TransformGroup.Children&gt;
                                                                        &lt;TransformCollection&gt;
                                                                            &lt;RotateTransform Angle="90" CenterX="9.5" CenterY="9.5"/&gt;
                                                                        &lt;/TransformCollection&gt;
                                                                    &lt;/TransformGroup.Children&gt;
                                                                &lt;/TransformGroup&gt;
                                                            &lt;/Grid.RenderTransform&gt;
                                                            &lt;Ellipse Fill="{StaticResource ExpanderArrowFill}" Height="19" HorizontalAlignment="Center" x:Name="circle" Width="19" Stroke="DarkGray" VerticalAlignment="Center"/&gt;
                                                            &lt;Path Data="M 1,1.5 L 4.5,5 L 8,1.5" HorizontalAlignment="Center" x:Name="arrow" Stroke="#666" StrokeThickness="2" VerticalAlignment="Center"/&gt;
                                                        &lt;/Grid&gt;
                                                        &lt;ContentPresenter Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" Grid.Row="1" HorizontalAlignment="Center" Margin="0,4,0,0" x:Name="header" VerticalAlignment="Top"/&gt;
                                                    &lt;/Grid&gt;
                                                &lt;/Border&gt;
                                                &lt;Rectangle IsHitTestVisible="false" x:Name="FocusVisualElement" Stroke="Green" StrokeDashArray="1 2" StrokeThickness="1" Visibility="Collapsed"/&gt;
                                            &lt;/Grid&gt;
                                        &lt;/ControlTemplate&gt;
                                        &lt;ControlTemplate x:Key="ExpanderRightHeaderTemplate" TargetType="ToggleButton"&gt;
                                            &lt;Grid Background="Transparent"&gt;
                                                &lt;vsm:VisualStateManager.VisualStateGroups&gt;
                                                    &lt;vsm:VisualStateGroup x:Name="CheckStates"&gt;
                                                        &lt;vsm:VisualStateGroup.Transitions&gt;
                                                            &lt;vsm:VisualTransition GeneratedDuration="00:00:00"/&gt;
                                                        &lt;/vsm:VisualStateGroup.Transitions&gt;
                                                        &lt;vsm:VisualState x:Name="Checked"&gt;
                                                            &lt;Storyboard&gt;
                                                                &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="Data"&gt;
                                                                    &lt;DiscreteObjectKeyFrame KeyTime="0" Value="M 1,4.5 L 4.5,1 L 8,4.5"/&gt;
                                                                &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                            &lt;/Storyboard&gt;
                                                        &lt;/vsm:VisualState&gt;
                                                        &lt;vsm:VisualState x:Name="Unchecked"/&gt;
                                                    &lt;/vsm:VisualStateGroup&gt;
                                                    &lt;vsm:VisualStateGroup x:Name="CommonStates"&gt;
                                                        &lt;vsm:VisualStateGroup.Transitions&gt;
                                                            &lt;vsm:VisualTransition GeneratedDuration="0"/&gt;
                                                            &lt;vsm:VisualTransition GeneratedDuration="00:00:00.1" To="MouseOver"/&gt;
                                                            &lt;vsm:VisualTransition GeneratedDuration="00:00:00.1" To="Pressed"/&gt;
                                                        &lt;/vsm:VisualStateGroup.Transitions&gt;
                                                        &lt;vsm:VisualState x:Name="Normal"/&gt;
                                                        &lt;vsm:VisualState x:Name="MouseOver"&gt;
                                                            &lt;Storyboard&gt;
                                                                &lt;ColorAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Stroke).(SolidColorBrush.Color)" To="#FF3C7FB1"/&gt;
                                                                &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Fill)"&gt;
                                                                    &lt;DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderArrowHoverFill}"/&gt;
                                                                &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                                &lt;ColorAnimation BeginTime="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="(Path.Stroke).(SolidColorBrush.Color)" To="#222"/&gt;
                                                            &lt;/Storyboard&gt;
                                                        &lt;/vsm:VisualState&gt;
                                                        &lt;vsm:VisualState x:Name="Pressed"&gt;
                                                            &lt;Storyboard&gt;
                                                                &lt;ColorAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Stroke).(SolidColorBrush.Color)" To="#FF526C7B"/&gt;
                                                                &lt;DoubleAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="StrokeThickness" To="1.5"/&gt;
                                                                &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Fill)"&gt;
                                                                    &lt;DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderArrowPressedFill}"/&gt;
                                                                &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                                &lt;ColorAnimation BeginTime="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="(Path.Stroke).(SolidColorBrush.Color)" To="#FF003366"/&gt;
                                                            &lt;/Storyboard&gt;
                                                        &lt;/vsm:VisualState&gt;
                                                    &lt;/vsm:VisualStateGroup&gt;
                                                    &lt;vsm:VisualStateGroup x:Name="FocusStates"&gt;
                                                        &lt;vsm:VisualState x:Name="Focused"&gt;
                                                            &lt;Storyboard&gt;
                                                                &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility"&gt;
                                                                    &lt;DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/&gt;
                                                                &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                            &lt;/Storyboard&gt;
                                                        &lt;/vsm:VisualState&gt;
                                                        &lt;vsm:VisualState x:Name="Unfocused"/&gt;
                                                    &lt;/vsm:VisualStateGroup&gt;
                                                &lt;/vsm:VisualStateManager.VisualStateGroups&gt;
                                                &lt;Border Padding="{TemplateBinding Padding}"&gt;
                                                    &lt;Grid Background="Transparent"&gt;
                                                        &lt;Grid.RowDefinitions&gt;
                                                            &lt;RowDefinition Height="19"/&gt;
                                                            &lt;RowDefinition Height="*"/&gt;
                                                        &lt;/Grid.RowDefinitions&gt;
                                                        &lt;Grid HorizontalAlignment="Center" VerticalAlignment="Top"&gt;
                                                            &lt;Grid.RenderTransform&gt;
                                                                &lt;TransformGroup&gt;
                                                                    &lt;TransformGroup.Children&gt;
                                                                        &lt;TransformCollection&gt;
                                                                            &lt;RotateTransform Angle="270" CenterX="9.5" CenterY="9.5"/&gt;
                                                                        &lt;/TransformCollection&gt;
                                                                    &lt;/TransformGroup.Children&gt;
                                                                &lt;/TransformGroup&gt;
                                                            &lt;/Grid.RenderTransform&gt;
                                                            &lt;Ellipse Fill="{StaticResource ExpanderArrowFill}" Height="19" HorizontalAlignment="Center" x:Name="circle" Stroke="DarkGray" VerticalAlignment="Center" Width="19"/&gt;
                                                            &lt;Path Data="M 1,1.5 L 4.5,5 L 8,1.5" HorizontalAlignment="Center" x:Name="arrow" Stroke="#666" StrokeThickness="2" VerticalAlignment="Center"/&gt;
                                                        &lt;/Grid&gt;
                                                        &lt;ContentPresenter Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" Grid.Row="1" HorizontalAlignment="Center" Margin="0,4,0,0" x:Name="header" VerticalAlignment="Top"/&gt;
                                                    &lt;/Grid&gt;
                                                &lt;/Border&gt;
                                                &lt;Rectangle IsHitTestVisible="false" x:Name="FocusVisualElement" Stroke="Green" StrokeDashArray="1 2" StrokeThickness="1" Visibility="Collapsed"/&gt;
                                            &lt;/Grid&gt;
                                        &lt;/ControlTemplate&gt;
                                    &lt;/Grid.Resources&gt;
                                    &lt;vsm:VisualStateManager.VisualStateGroups&gt;
                                        &lt;vsm:VisualStateGroup x:Name="CommonStates"&gt;
                                            &lt;vsm:VisualStateGroup.Transitions&gt;
                                                &lt;vsm:VisualTransition GeneratedDuration="0"/&gt;
                                            &lt;/vsm:VisualStateGroup.Transitions&gt;
                                            &lt;vsm:VisualState x:Name="Normal"/&gt;
                                            &lt;vsm:VisualState x:Name="Disabled"&gt;
                                                &lt;Storyboard&gt;
                                                    &lt;DoubleAnimation Duration="0" Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="(UIElement.Opacity)" To="1"/&gt;
                                                &lt;/Storyboard&gt;
                                            &lt;/vsm:VisualState&gt;
                                        &lt;/vsm:VisualStateGroup&gt;
                                        &lt;vsm:VisualStateGroup x:Name="FocusStates"&gt;
                                            &lt;vsm:VisualState x:Name="Focused"&gt;
                                                &lt;Storyboard&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                &lt;/Storyboard&gt;
                                            &lt;/vsm:VisualState&gt;
                                            &lt;vsm:VisualState x:Name="Unfocused"/&gt;
                                        &lt;/vsm:VisualStateGroup&gt;
                                        &lt;vsm:VisualStateGroup x:Name="ExpansionStates"&gt;
                                            &lt;vsm:VisualStateGroup.Transitions&gt;
                                                &lt;vsm:VisualTransition GeneratedDuration="00:00:00.2000000"/&gt;
                                            &lt;/vsm:VisualStateGroup.Transitions&gt;
                                            &lt;vsm:VisualState x:Name="Collapsed"&gt;
                                                &lt;Storyboard&gt;
                                                    &lt;DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(UIElement.Opacity)"&gt;
                                                        &lt;SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/&gt;
                                                    &lt;/DoubleAnimationUsingKeyFrames&gt;
                                                &lt;/Storyboard&gt;
                                            &lt;/vsm:VisualState&gt;
                                            &lt;vsm:VisualState x:Name="Expanded"/&gt;
                                        &lt;/vsm:VisualStateGroup&gt;
                                        &lt;vsm:VisualStateGroup x:Name="ExpandDirectionStates"&gt;
                                            &lt;vsm:VisualStateGroup.Transitions&gt;
                                                &lt;vsm:VisualTransition GeneratedDuration="0"/&gt;
                                            &lt;/vsm:VisualStateGroup.Transitions&gt;
                                            &lt;vsm:VisualState x:Name="ExpandDown"&gt;
                                                &lt;Storyboard&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="rd1" Storyboard.TargetProperty="Height"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="*"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="cd0" Storyboard.TargetProperty="Width"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="*"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                &lt;/Storyboard&gt;
                                            &lt;/vsm:VisualState&gt;
                                            &lt;vsm:VisualState x:Name="ExpandUp"&gt;
                                                &lt;Storyboard&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="Template"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderUpHeaderTemplate}"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="(Grid.Row)"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="1"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(Grid.Row)"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="0"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="rd0" Storyboard.TargetProperty="Height"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="*"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="cd0" Storyboard.TargetProperty="Width"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="*"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                &lt;/Storyboard&gt;
                                            &lt;/vsm:VisualState&gt;
                                            &lt;vsm:VisualState x:Name="ExpandLeft"&gt;
                                                &lt;Storyboard&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="Template"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderLeftHeaderTemplate}"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="(Grid.Column)"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="1"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(Grid.Row)"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="0"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="rd0" Storyboard.TargetProperty="Height"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="*"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="cd0" Storyboard.TargetProperty="Width"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="*"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                &lt;/Storyboard&gt;
                                            &lt;/vsm:VisualState&gt;
                                            &lt;vsm:VisualState x:Name="ExpandRight"&gt;
                                                &lt;Storyboard&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="Template"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="00:00:00.1000000" Value="{StaticResource ExpanderLeftHeaderTemplate}"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(Grid.Row)"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="0"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(Grid.Column)"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="1"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="rd0" Storyboard.TargetProperty="Height"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="*"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="cd1" Storyboard.TargetProperty="Width"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="*"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                &lt;/Storyboard&gt;
                                            &lt;/vsm:VisualState&gt;
                                        &lt;/vsm:VisualStateGroup&gt;
                                    &lt;/vsm:VisualStateManager.VisualStateGroups&gt;
                                    &lt;Border x:Name="Background" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3"&gt;
                                        &lt;Grid&gt;
                                            &lt;Grid.RowDefinitions&gt;
                                                &lt;RowDefinition Height="Auto" x:Name="rd0"/&gt;
                                                &lt;RowDefinition Height="Auto" x:Name="rd1"/&gt;
                                            &lt;/Grid.RowDefinitions&gt;
                                            &lt;Grid.ColumnDefinitions&gt;
                                                &lt;ColumnDefinition Width="Auto" x:Name="cd0"/&gt;
                                                &lt;ColumnDefinition Width="Auto" x:Name="cd1"/&gt;
                                            &lt;/Grid.ColumnDefinitions&gt;
                                            &lt;ToggleButton Content="{TemplateBinding Header}" ContentTemplate="{TemplateBinding HeaderTemplate}" FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}" FontStretch="{TemplateBinding FontStretch}" FontStyle="{TemplateBinding FontStyle}" FontWeight="{TemplateBinding FontWeight}" Foreground="{TemplateBinding Foreground}" Grid.Column="0" Grid.Row="0" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" IsChecked="{TemplateBinding IsExpanded}" Margin="1" MinHeight="0" MinWidth="0" x:Name="ExpanderButton" Padding="{TemplateBinding Padding}" Template="{StaticResource ExpanderDownHeaderTemplate}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/&gt;
                                            &lt;ContentControl Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}" FontStretch="{TemplateBinding FontStretch}" FontStyle="{TemplateBinding FontStyle}" FontWeight="{TemplateBinding FontWeight}" Foreground="{TemplateBinding Foreground}" Grid.Column="0" Grid.Row="1" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" x:Name="ExpandSite" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" Visibility="Visible" Opacity="1"/&gt;
                                        &lt;/Grid&gt;
                                    &lt;/Border&gt;
                                    &lt;Border x:Name="DisabledVisualElement" IsHitTestVisible="false" Opacity="0" Background="#A5FFFFFF" CornerRadius="3"/&gt;
                                    &lt;Border x:Name="FocusVisualElement" IsHitTestVisible="false" Visibility="Collapsed" BorderThickness="1" CornerRadius="3"&gt;
                                        &lt;Border.BorderBrush&gt;
                                            &lt;LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"&gt;
                                                &lt;GradientStop Color="#FFA3AEB9"/&gt;
                                                &lt;GradientStop Color="#FF8399A9" Offset="0.375"/&gt;
                                                &lt;GradientStop Color="#FF718597" Offset="0.375"/&gt;
                                                &lt;GradientStop Color="#FF617584" Offset="1"/&gt;
                                            &lt;/LinearGradientBrush&gt;
                                        &lt;/Border.BorderBrush&gt;
                                    &lt;/Border&gt;
                                &lt;/Grid&gt;
                            &lt;/ControlTemplate&gt;
                        &lt;/Setter.Value&gt;
                    &lt;/Setter&gt;
                &lt;/Style&gt;
                &lt;Style x:Key="ExpanderScaleStyle" TargetType="toolkit:Expander"&gt;
                    &lt;Setter Property="Background" Value="Transparent"/&gt;
                    &lt;Setter Property="BorderBrush" Value="Transparent"/&gt;
                    &lt;Setter Property="BorderThickness" Value="1"/&gt;
                    &lt;Setter Property="HorizontalContentAlignment" Value="Stretch"/&gt;
                    &lt;Setter Property="VerticalContentAlignment" Value="Stretch"/&gt;
                    &lt;Setter Property="Template"&gt;
                        &lt;Setter.Value&gt;
                            &lt;ControlTemplate TargetType="toolkit:Expander"&gt;
                                &lt;Grid Background="Transparent"&gt;
                                    &lt;Grid.Resources&gt;
                                        &lt;LinearGradientBrush x:Key="ExpanderArrowFill" EndPoint="0,1" StartPoint="0,0"&gt;
                                            &lt;GradientStop Color="White" Offset="0"/&gt;
                                            &lt;GradientStop Color="#FFBFBFBF" Offset="0.5"/&gt;
                                            &lt;GradientStop Color="#FF878787" Offset="1"/&gt;
                                        &lt;/LinearGradientBrush&gt;
                                        &lt;LinearGradientBrush x:Key="ExpanderArrowHoverFill" EndPoint="0,1" StartPoint="0,0"&gt;
                                            &lt;GradientStop Color="#FFF0F8FE" Offset="0"/&gt;
                                            &lt;GradientStop Color="#FFE0F3FE" Offset="0.3"/&gt;
                                            &lt;GradientStop Color="#FF6FA7C5" Offset="1"/&gt;
                                        &lt;/LinearGradientBrush&gt;
                                        &lt;LinearGradientBrush x:Key="ExpanderArrowPressedFill" EndPoint="0,1" StartPoint="0,0"&gt;
                                            &lt;GradientStop Color="#FFDCF0FA" Offset="0"/&gt;
                                            &lt;GradientStop Color="#FFC5E6F7" Offset="0.2"/&gt;
                                            &lt;GradientStop Color="#FF5690D0" Offset="1"/&gt;
                                        &lt;/LinearGradientBrush&gt;
                                        &lt;ControlTemplate x:Key="ExpanderDownHeaderTemplate" TargetType="ToggleButton"&gt;
                                            &lt;Grid Background="Transparent"&gt;
                                                &lt;vsm:VisualStateManager.VisualStateGroups&gt;
                                                    &lt;vsm:VisualStateGroup x:Name="CheckStates"&gt;
                                                        &lt;vsm:VisualStateGroup.Transitions&gt;
                                                            &lt;vsm:VisualTransition GeneratedDuration="00:00:00"/&gt;
                                                        &lt;/vsm:VisualStateGroup.Transitions&gt;
                                                        &lt;vsm:VisualState x:Name="Checked"&gt;
                                                            &lt;Storyboard&gt;
                                                                &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="Data"&gt;
                                                                    &lt;DiscreteObjectKeyFrame KeyTime="0" Value="M 1,4.5 L 4.5,1 L 8,4.5"/&gt;
                                                                &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                            &lt;/Storyboard&gt;
                                                        &lt;/vsm:VisualState&gt;
                                                        &lt;vsm:VisualState x:Name="Unchecked"/&gt;
                                                    &lt;/vsm:VisualStateGroup&gt;
                                                    &lt;vsm:VisualStateGroup x:Name="CommonStates"&gt;
                                                        &lt;vsm:VisualStateGroup.Transitions&gt;
                                                            &lt;vsm:VisualTransition GeneratedDuration="0"/&gt;
                                                            &lt;vsm:VisualTransition GeneratedDuration="00:00:00.1" To="MouseOver"/&gt;
                                                            &lt;vsm:VisualTransition GeneratedDuration="00:00:00.1" To="Pressed"/&gt;
                                                        &lt;/vsm:VisualStateGroup.Transitions&gt;
                                                        &lt;vsm:VisualState x:Name="Normal"/&gt;
                                                        &lt;vsm:VisualState x:Name="MouseOver"&gt;
                                                            &lt;Storyboard&gt;
                                                                &lt;ColorAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Stroke).(SolidColorBrush.Color)" To="#FF3C7FB1"/&gt;
                                                                &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Fill)"&gt;
                                                                    &lt;DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderArrowHoverFill}"/&gt;
                                                                &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                                &lt;ColorAnimation BeginTime="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="(Path.Stroke).(SolidColorBrush.Color)" To="#222"/&gt;
                                                            &lt;/Storyboard&gt;
                                                        &lt;/vsm:VisualState&gt;
                                                        &lt;vsm:VisualState x:Name="Pressed"&gt;
                                                            &lt;Storyboard&gt;
                                                                &lt;ColorAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Stroke).(SolidColorBrush.Color)" To="#FF526C7B"/&gt;
                                                                &lt;DoubleAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="StrokeThickness" To="1.5"/&gt;
                                                                &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Fill)"&gt;
                                                                    &lt;DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderArrowPressedFill}"/&gt;
                                                                &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                                &lt;ColorAnimation BeginTime="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="(Path.Stroke).(SolidColorBrush.Color)" To="#FF003366"/&gt;
                                                            &lt;/Storyboard&gt;
                                                        &lt;/vsm:VisualState&gt;
                                                    &lt;/vsm:VisualStateGroup&gt;
                                                    &lt;vsm:VisualStateGroup x:Name="FocusStates"&gt;
                                                        &lt;vsm:VisualState x:Name="Focused"&gt;
                                                            &lt;Storyboard&gt;
                                                                &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility"&gt;
                                                                    &lt;DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/&gt;
                                                                &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                            &lt;/Storyboard&gt;
                                                        &lt;/vsm:VisualState&gt;
                                                        &lt;vsm:VisualState x:Name="Unfocused"/&gt;
                                                    &lt;/vsm:VisualStateGroup&gt;
                                                &lt;/vsm:VisualStateManager.VisualStateGroups&gt;
                                                &lt;Border Padding="{TemplateBinding Padding}"&gt;
                                                    &lt;Grid Background="Transparent"&gt;
                                                        &lt;Grid.ColumnDefinitions&gt;
                                                            &lt;ColumnDefinition Width="19"/&gt;
                                                            &lt;ColumnDefinition Width="*"/&gt;
                                                        &lt;/Grid.ColumnDefinitions&gt;
                                                        &lt;Grid HorizontalAlignment="Left" VerticalAlignment="Top"&gt;
                                                            &lt;Ellipse Fill="{StaticResource ExpanderArrowFill}" Height="19" HorizontalAlignment="Center" x:Name="circle" Stroke="DarkGray" VerticalAlignment="Center" Width="19"/&gt;
                                                            &lt;Path Data="M 1,1.5 L 4.5,5 L 8,1.5" HorizontalAlignment="Center" x:Name="arrow" Stroke="#666" StrokeThickness="2" VerticalAlignment="Center"/&gt;
                                                        &lt;/Grid&gt;
                                                        &lt;ContentPresenter Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" Grid.Column="1" HorizontalAlignment="Left" Margin="4,0,0,0" x:Name="header" VerticalAlignment="Center"/&gt;
                                                    &lt;/Grid&gt;
                                                &lt;/Border&gt;
                                                &lt;Rectangle IsHitTestVisible="false" x:Name="FocusVisualElement" Stroke="Green" StrokeDashArray="1 2" StrokeThickness="1" Visibility="Collapsed"/&gt;
                                            &lt;/Grid&gt;
                                        &lt;/ControlTemplate&gt;
                                        &lt;ControlTemplate x:Key="ExpanderUpHeaderTemplate" TargetType="ToggleButton"&gt;
                                            &lt;Grid Background="Transparent"&gt;
                                                &lt;vsm:VisualStateManager.VisualStateGroups&gt;
                                                    &lt;vsm:VisualStateGroup x:Name="CheckStates"&gt;
                                                        &lt;vsm:VisualStateGroup.Transitions&gt;
                                                            &lt;vsm:VisualTransition GeneratedDuration="00:00:00"/&gt;
                                                        &lt;/vsm:VisualStateGroup.Transitions&gt;
                                                        &lt;vsm:VisualState x:Name="Checked"&gt;
                                                            &lt;Storyboard&gt;
                                                                &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="Data"&gt;
                                                                    &lt;DiscreteObjectKeyFrame KeyTime="0" Value="M 1,4.5 L 4.5,1 L 8,4.5"/&gt;
                                                                &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                            &lt;/Storyboard&gt;
                                                        &lt;/vsm:VisualState&gt;
                                                        &lt;vsm:VisualState x:Name="Unchecked"/&gt;
                                                    &lt;/vsm:VisualStateGroup&gt;
                                                    &lt;vsm:VisualStateGroup x:Name="CommonStates"&gt;
                                                        &lt;vsm:VisualStateGroup.Transitions&gt;
                                                            &lt;vsm:VisualTransition GeneratedDuration="0"/&gt;
                                                            &lt;vsm:VisualTransition GeneratedDuration="00:00:00.1" To="MouseOver"/&gt;
                                                            &lt;vsm:VisualTransition GeneratedDuration="00:00:00.1" To="Pressed"/&gt;
                                                        &lt;/vsm:VisualStateGroup.Transitions&gt;
                                                        &lt;vsm:VisualState x:Name="Normal"/&gt;
                                                        &lt;vsm:VisualState x:Name="MouseOver"&gt;
                                                            &lt;Storyboard&gt;
                                                                &lt;ColorAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Stroke).(SolidColorBrush.Color)" To="#FF3C7FB1"/&gt;
                                                                &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Fill)"&gt;
                                                                    &lt;DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderArrowHoverFill}"/&gt;
                                                                &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                                &lt;ColorAnimation BeginTime="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="(Path.Stroke).(SolidColorBrush.Color)" To="#222"/&gt;
                                                            &lt;/Storyboard&gt;
                                                        &lt;/vsm:VisualState&gt;
                                                        &lt;vsm:VisualState x:Name="Pressed"&gt;
                                                            &lt;Storyboard&gt;
                                                                &lt;ColorAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Stroke).(SolidColorBrush.Color)" To="#FF526C7B"/&gt;
                                                                &lt;DoubleAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="StrokeThickness" To="1.5"/&gt;
                                                                &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Fill)"&gt;
                                                                    &lt;DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderArrowPressedFill}"/&gt;
                                                                &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                                &lt;ColorAnimation BeginTime="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="(Path.Stroke).(SolidColorBrush.Color)" To="#FF003366"/&gt;
                                                            &lt;/Storyboard&gt;
                                                        &lt;/vsm:VisualState&gt;
                                                    &lt;/vsm:VisualStateGroup&gt;
                                                    &lt;vsm:VisualStateGroup x:Name="FocusStates"&gt;
                                                        &lt;vsm:VisualState x:Name="Focused"&gt;
                                                            &lt;Storyboard&gt;
                                                                &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility"&gt;
                                                                    &lt;DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/&gt;
                                                                &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                            &lt;/Storyboard&gt;
                                                        &lt;/vsm:VisualState&gt;
                                                        &lt;vsm:VisualState x:Name="Unfocused"/&gt;
                                                    &lt;/vsm:VisualStateGroup&gt;
                                                &lt;/vsm:VisualStateManager.VisualStateGroups&gt;
                                                &lt;Border Padding="{TemplateBinding Padding}"&gt;
                                                    &lt;Grid Background="Transparent"&gt;
                                                        &lt;Grid.ColumnDefinitions&gt;
                                                            &lt;ColumnDefinition Width="19"/&gt;
                                                            &lt;ColumnDefinition Width="*"/&gt;
                                                        &lt;/Grid.ColumnDefinitions&gt;
                                                        &lt;Grid HorizontalAlignment="Left" VerticalAlignment="Top"&gt;
                                                            &lt;Grid.RenderTransform&gt;
                                                                &lt;TransformGroup&gt;
                                                                    &lt;TransformGroup.Children&gt;
                                                                        &lt;TransformCollection&gt;
                                                                            &lt;RotateTransform Angle="180" CenterX="9.5" CenterY="9.5"/&gt;
                                                                        &lt;/TransformCollection&gt;
                                                                    &lt;/TransformGroup.Children&gt;
                                                                &lt;/TransformGroup&gt;
                                                            &lt;/Grid.RenderTransform&gt;
                                                            &lt;Ellipse Fill="{StaticResource ExpanderArrowFill}" Height="19" HorizontalAlignment="Center" x:Name="circle" Stroke="DarkGray" VerticalAlignment="Center" Width="19"/&gt;
                                                            &lt;Path Data="M 1,1.5 L 4.5,5 L 8,1.5" HorizontalAlignment="Center" x:Name="arrow" Stroke="#666" StrokeThickness="2" VerticalAlignment="Center"/&gt;
                                                        &lt;/Grid&gt;
                                                        &lt;ContentPresenter Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" Grid.Column="1" HorizontalAlignment="Left" Margin="4,0,0,0" x:Name="header" VerticalAlignment="Center"/&gt;
                                                    &lt;/Grid&gt;
                                                &lt;/Border&gt;
                                                &lt;Rectangle IsHitTestVisible="false" x:Name="FocusVisualElement" Stroke="Green" StrokeDashArray="1 2" StrokeThickness="1" Visibility="Collapsed"/&gt;
                                            &lt;/Grid&gt;
                                        &lt;/ControlTemplate&gt;
                                        &lt;ControlTemplate x:Key="ExpanderLeftHeaderTemplate" TargetType="ToggleButton"&gt;
                                            &lt;Grid Background="Transparent"&gt;
                                                &lt;vsm:VisualStateManager.VisualStateGroups&gt;
                                                    &lt;vsm:VisualStateGroup x:Name="CheckStates"&gt;
                                                        &lt;vsm:VisualStateGroup.Transitions&gt;
                                                            &lt;vsm:VisualTransition GeneratedDuration="00:00:00"/&gt;
                                                        &lt;/vsm:VisualStateGroup.Transitions&gt;
                                                        &lt;vsm:VisualState x:Name="Checked"&gt;
                                                            &lt;Storyboard&gt;
                                                                &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="Data"&gt;
                                                                    &lt;DiscreteObjectKeyFrame KeyTime="0" Value="M 1,4.5 L 4.5,1 L 8,4.5"/&gt;
                                                                &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                            &lt;/Storyboard&gt;
                                                        &lt;/vsm:VisualState&gt;
                                                        &lt;vsm:VisualState x:Name="Unchecked"/&gt;
                                                    &lt;/vsm:VisualStateGroup&gt;
                                                    &lt;vsm:VisualStateGroup x:Name="CommonStates"&gt;
                                                        &lt;vsm:VisualStateGroup.Transitions&gt;
                                                            &lt;vsm:VisualTransition GeneratedDuration="0"/&gt;
                                                            &lt;vsm:VisualTransition GeneratedDuration="00:00:00.1" To="MouseOver"/&gt;
                                                            &lt;vsm:VisualTransition GeneratedDuration="00:00:00.1" To="Pressed"/&gt;
                                                        &lt;/vsm:VisualStateGroup.Transitions&gt;
                                                        &lt;vsm:VisualState x:Name="Normal"/&gt;
                                                        &lt;vsm:VisualState x:Name="MouseOver"&gt;
                                                            &lt;Storyboard&gt;
                                                                &lt;ColorAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Stroke).(SolidColorBrush.Color)" To="#FF3C7FB1"/&gt;
                                                                &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Fill)"&gt;
                                                                    &lt;DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderArrowHoverFill}"/&gt;
                                                                &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                                &lt;ColorAnimation BeginTime="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="(Path.Stroke).(SolidColorBrush.Color)" To="#222"/&gt;
                                                            &lt;/Storyboard&gt;
                                                        &lt;/vsm:VisualState&gt;
                                                        &lt;vsm:VisualState x:Name="Pressed"&gt;
                                                            &lt;Storyboard&gt;
                                                                &lt;ColorAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Stroke).(SolidColorBrush.Color)" To="#FF526C7B"/&gt;
                                                                &lt;DoubleAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="StrokeThickness" To="1.5"/&gt;
                                                                &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Fill)"&gt;
                                                                    &lt;DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderArrowPressedFill}"/&gt;
                                                                &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                                &lt;ColorAnimation BeginTime="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="(Path.Stroke).(SolidColorBrush.Color)" To="#FF003366"/&gt;
                                                            &lt;/Storyboard&gt;
                                                        &lt;/vsm:VisualState&gt;
                                                    &lt;/vsm:VisualStateGroup&gt;
                                                    &lt;vsm:VisualStateGroup x:Name="FocusStates"&gt;
                                                        &lt;vsm:VisualState x:Name="Focused"&gt;
                                                            &lt;Storyboard&gt;
                                                                &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility"&gt;
                                                                    &lt;DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/&gt;
                                                                &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                            &lt;/Storyboard&gt;
                                                        &lt;/vsm:VisualState&gt;
                                                        &lt;vsm:VisualState x:Name="Unfocused"/&gt;
                                                    &lt;/vsm:VisualStateGroup&gt;
                                                &lt;/vsm:VisualStateManager.VisualStateGroups&gt;
                                                &lt;Border Padding="{TemplateBinding Padding}"&gt;
                                                    &lt;Grid Background="Transparent"&gt;
                                                        &lt;Grid.RowDefinitions&gt;
                                                            &lt;RowDefinition Height="19"/&gt;
                                                            &lt;RowDefinition Height="*"/&gt;
                                                        &lt;/Grid.RowDefinitions&gt;
                                                        &lt;Grid HorizontalAlignment="Center" VerticalAlignment="Top"&gt;
                                                            &lt;Grid.RenderTransform&gt;
                                                                &lt;TransformGroup&gt;
                                                                    &lt;TransformGroup.Children&gt;
                                                                        &lt;TransformCollection&gt;
                                                                            &lt;RotateTransform Angle="90" CenterX="9.5" CenterY="9.5"/&gt;
                                                                        &lt;/TransformCollection&gt;
                                                                    &lt;/TransformGroup.Children&gt;
                                                                &lt;/TransformGroup&gt;
                                                            &lt;/Grid.RenderTransform&gt;
                                                            &lt;Ellipse Fill="{StaticResource ExpanderArrowFill}" Height="19" HorizontalAlignment="Center" x:Name="circle" Width="19" Stroke="DarkGray" VerticalAlignment="Center"/&gt;
                                                            &lt;Path Data="M 1,1.5 L 4.5,5 L 8,1.5" HorizontalAlignment="Center" x:Name="arrow" Stroke="#666" StrokeThickness="2" VerticalAlignment="Center"/&gt;
                                                        &lt;/Grid&gt;
                                                        &lt;ContentPresenter Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" Grid.Row="1" HorizontalAlignment="Center" Margin="0,4,0,0" x:Name="header" VerticalAlignment="Top"/&gt;
                                                    &lt;/Grid&gt;
                                                &lt;/Border&gt;
                                                &lt;Rectangle IsHitTestVisible="false" x:Name="FocusVisualElement" Stroke="Green" StrokeDashArray="1 2" StrokeThickness="1" Visibility="Collapsed"/&gt;
                                            &lt;/Grid&gt;
                                        &lt;/ControlTemplate&gt;
                                        &lt;ControlTemplate x:Key="ExpanderRightHeaderTemplate" TargetType="ToggleButton"&gt;
                                            &lt;Grid Background="Transparent"&gt;
                                                &lt;vsm:VisualStateManager.VisualStateGroups&gt;
                                                    &lt;vsm:VisualStateGroup x:Name="CheckStates"&gt;
                                                        &lt;vsm:VisualStateGroup.Transitions&gt;
                                                            &lt;vsm:VisualTransition GeneratedDuration="00:00:00"/&gt;
                                                        &lt;/vsm:VisualStateGroup.Transitions&gt;
                                                        &lt;vsm:VisualState x:Name="Checked"&gt;
                                                            &lt;Storyboard&gt;
                                                                &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="Data"&gt;
                                                                    &lt;DiscreteObjectKeyFrame KeyTime="0" Value="M 1,4.5 L 4.5,1 L 8,4.5"/&gt;
                                                                &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                            &lt;/Storyboard&gt;
                                                        &lt;/vsm:VisualState&gt;
                                                        &lt;vsm:VisualState x:Name="Unchecked"/&gt;
                                                    &lt;/vsm:VisualStateGroup&gt;
                                                    &lt;vsm:VisualStateGroup x:Name="CommonStates"&gt;
                                                        &lt;vsm:VisualStateGroup.Transitions&gt;
                                                            &lt;vsm:VisualTransition GeneratedDuration="0"/&gt;
                                                            &lt;vsm:VisualTransition GeneratedDuration="00:00:00.1" To="MouseOver"/&gt;
                                                            &lt;vsm:VisualTransition GeneratedDuration="00:00:00.1" To="Pressed"/&gt;
                                                        &lt;/vsm:VisualStateGroup.Transitions&gt;
                                                        &lt;vsm:VisualState x:Name="Normal"/&gt;
                                                        &lt;vsm:VisualState x:Name="MouseOver"&gt;
                                                            &lt;Storyboard&gt;
                                                                &lt;ColorAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Stroke).(SolidColorBrush.Color)" To="#FF3C7FB1"/&gt;
                                                                &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Fill)"&gt;
                                                                    &lt;DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderArrowHoverFill}"/&gt;
                                                                &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                                &lt;ColorAnimation BeginTime="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="(Path.Stroke).(SolidColorBrush.Color)" To="#222"/&gt;
                                                            &lt;/Storyboard&gt;
                                                        &lt;/vsm:VisualState&gt;
                                                        &lt;vsm:VisualState x:Name="Pressed"&gt;
                                                            &lt;Storyboard&gt;
                                                                &lt;ColorAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Stroke).(SolidColorBrush.Color)" To="#FF526C7B"/&gt;
                                                                &lt;DoubleAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="StrokeThickness" To="1.5"/&gt;
                                                                &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Fill)"&gt;
                                                                    &lt;DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderArrowPressedFill}"/&gt;
                                                                &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                                &lt;ColorAnimation BeginTime="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="(Path.Stroke).(SolidColorBrush.Color)" To="#FF003366"/&gt;
                                                            &lt;/Storyboard&gt;
                                                        &lt;/vsm:VisualState&gt;
                                                    &lt;/vsm:VisualStateGroup&gt;
                                                    &lt;vsm:VisualStateGroup x:Name="FocusStates"&gt;
                                                        &lt;vsm:VisualState x:Name="Focused"&gt;
                                                            &lt;Storyboard&gt;
                                                                &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility"&gt;
                                                                    &lt;DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/&gt;
                                                                &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                            &lt;/Storyboard&gt;
                                                        &lt;/vsm:VisualState&gt;
                                                        &lt;vsm:VisualState x:Name="Unfocused"/&gt;
                                                    &lt;/vsm:VisualStateGroup&gt;
                                                &lt;/vsm:VisualStateManager.VisualStateGroups&gt;
                                                &lt;Border Padding="{TemplateBinding Padding}"&gt;
                                                    &lt;Grid Background="Transparent"&gt;
                                                        &lt;Grid.RowDefinitions&gt;
                                                            &lt;RowDefinition Height="19"/&gt;
                                                            &lt;RowDefinition Height="*"/&gt;
                                                        &lt;/Grid.RowDefinitions&gt;
                                                        &lt;Grid HorizontalAlignment="Center" VerticalAlignment="Top"&gt;
                                                            &lt;Grid.RenderTransform&gt;
                                                                &lt;TransformGroup&gt;
                                                                    &lt;TransformGroup.Children&gt;
                                                                        &lt;TransformCollection&gt;
                                                                            &lt;RotateTransform Angle="270" CenterX="9.5" CenterY="9.5"/&gt;
                                                                        &lt;/TransformCollection&gt;
                                                                    &lt;/TransformGroup.Children&gt;
                                                                &lt;/TransformGroup&gt;
                                                            &lt;/Grid.RenderTransform&gt;
                                                            &lt;Ellipse Fill="{StaticResource ExpanderArrowFill}" Height="19" HorizontalAlignment="Center" x:Name="circle" Stroke="DarkGray" VerticalAlignment="Center" Width="19"/&gt;
                                                            &lt;Path Data="M 1,1.5 L 4.5,5 L 8,1.5" HorizontalAlignment="Center" x:Name="arrow" Stroke="#666" StrokeThickness="2" VerticalAlignment="Center"/&gt;
                                                        &lt;/Grid&gt;
                                                        &lt;ContentPresenter Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" Grid.Row="1" HorizontalAlignment="Center" Margin="0,4,0,0" x:Name="header" VerticalAlignment="Top"/&gt;
                                                    &lt;/Grid&gt;
                                                &lt;/Border&gt;
                                                &lt;Rectangle IsHitTestVisible="false" x:Name="FocusVisualElement" Stroke="Green" StrokeDashArray="1 2" StrokeThickness="1" Visibility="Collapsed"/&gt;
                                            &lt;/Grid&gt;
                                        &lt;/ControlTemplate&gt;
                                    &lt;/Grid.Resources&gt;
                                    &lt;vsm:VisualStateManager.VisualStateGroups&gt;
                                        &lt;vsm:VisualStateGroup x:Name="CommonStates"&gt;
                                            &lt;vsm:VisualStateGroup.Transitions&gt;
                                                &lt;vsm:VisualTransition GeneratedDuration="0"/&gt;
                                            &lt;/vsm:VisualStateGroup.Transitions&gt;
                                            &lt;vsm:VisualState x:Name="Normal"/&gt;
                                            &lt;vsm:VisualState x:Name="Disabled"&gt;
                                                &lt;Storyboard&gt;
                                                    &lt;DoubleAnimation Duration="0" Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="(UIElement.Opacity)" To="1"/&gt;
                                                &lt;/Storyboard&gt;
                                            &lt;/vsm:VisualState&gt;
                                        &lt;/vsm:VisualStateGroup&gt;
                                        &lt;vsm:VisualStateGroup x:Name="FocusStates"&gt;
                                            &lt;vsm:VisualState x:Name="Focused"&gt;
                                                &lt;Storyboard&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                &lt;/Storyboard&gt;
                                            &lt;/vsm:VisualState&gt;
                                            &lt;vsm:VisualState x:Name="Unfocused"/&gt;
                                        &lt;/vsm:VisualStateGroup&gt;
                                        &lt;vsm:VisualStateGroup x:Name="ExpansionStates"&gt;
                                            &lt;vsm:VisualStateGroup.Transitions&gt;
                                                &lt;vsm:VisualTransition GeneratedDuration="00:00:00.2000000"/&gt;
                                            &lt;/vsm:VisualStateGroup.Transitions&gt;
                                            &lt;vsm:VisualState x:Name="Collapsed"&gt;
                                                &lt;Storyboard&gt;
                                                    &lt;DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)"&gt;
                                                        &lt;SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/&gt;
                                                    &lt;/DoubleAnimationUsingKeyFrames&gt;
                                                    &lt;DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)"&gt;
                                                        &lt;SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/&gt;
                                                    &lt;/DoubleAnimationUsingKeyFrames&gt;
                                                &lt;/Storyboard&gt;
                                            &lt;/vsm:VisualState&gt;
                                            &lt;vsm:VisualState x:Name="Expanded"/&gt;
                                        &lt;/vsm:VisualStateGroup&gt;
                                        &lt;vsm:VisualStateGroup x:Name="ExpandDirectionStates"&gt;
                                            &lt;vsm:VisualStateGroup.Transitions&gt;
                                                &lt;vsm:VisualTransition GeneratedDuration="0"/&gt;
                                            &lt;/vsm:VisualStateGroup.Transitions&gt;
                                            &lt;vsm:VisualState x:Name="ExpandDown"&gt;
                                                &lt;Storyboard&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="rd1" Storyboard.TargetProperty="Height"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="*"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="cd0" Storyboard.TargetProperty="Width"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="*"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                &lt;/Storyboard&gt;
                                            &lt;/vsm:VisualState&gt;
                                            &lt;vsm:VisualState x:Name="ExpandUp"&gt;
                                                &lt;Storyboard&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="Template"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderUpHeaderTemplate}"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="(Grid.Row)"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="1"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(Grid.Row)"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="0"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="rd0" Storyboard.TargetProperty="Height"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="*"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="cd0" Storyboard.TargetProperty="Width"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="*"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                &lt;/Storyboard&gt;
                                            &lt;/vsm:VisualState&gt;
                                            &lt;vsm:VisualState x:Name="ExpandLeft"&gt;
                                                &lt;Storyboard&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="Template"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderLeftHeaderTemplate}"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="(Grid.Column)"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="1"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(Grid.Row)"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="0"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="rd0" Storyboard.TargetProperty="Height"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="*"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="cd0" Storyboard.TargetProperty="Width"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="*"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                &lt;/Storyboard&gt;
                                            &lt;/vsm:VisualState&gt;
                                            &lt;vsm:VisualState x:Name="ExpandRight"&gt;
                                                &lt;Storyboard&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="Template"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="00:00:00.1000000" Value="{StaticResource ExpanderLeftHeaderTemplate}"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(Grid.Row)"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="0"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(Grid.Column)"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="1"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="rd0" Storyboard.TargetProperty="Height"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="*"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="cd1" Storyboard.TargetProperty="Width"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="*"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                &lt;/Storyboard&gt;
                                            &lt;/vsm:VisualState&gt;
                                        &lt;/vsm:VisualStateGroup&gt;
                                    &lt;/vsm:VisualStateManager.VisualStateGroups&gt;
                                    &lt;Border x:Name="Background" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3"&gt;
                                        &lt;Grid&gt;
                                            &lt;Grid.RowDefinitions&gt;
                                                &lt;RowDefinition Height="Auto" x:Name="rd0"/&gt;
                                                &lt;RowDefinition Height="Auto" x:Name="rd1"/&gt;
                                            &lt;/Grid.RowDefinitions&gt;
                                            &lt;Grid.ColumnDefinitions&gt;
                                                &lt;ColumnDefinition Width="Auto" x:Name="cd0"/&gt;
                                                &lt;ColumnDefinition Width="Auto" x:Name="cd1"/&gt;
                                            &lt;/Grid.ColumnDefinitions&gt;
                                            &lt;ToggleButton Content="{TemplateBinding Header}" ContentTemplate="{TemplateBinding HeaderTemplate}" FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}" FontStretch="{TemplateBinding FontStretch}" FontStyle="{TemplateBinding FontStyle}" FontWeight="{TemplateBinding FontWeight}" Foreground="{TemplateBinding Foreground}" Grid.Column="0" Grid.Row="0" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" IsChecked="{TemplateBinding IsExpanded}" Margin="1" MinHeight="0" MinWidth="0" x:Name="ExpanderButton" Padding="{TemplateBinding Padding}" Template="{StaticResource ExpanderDownHeaderTemplate}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/&gt;
                                            &lt;ContentControl Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}" FontStretch="{TemplateBinding FontStretch}" FontStyle="{TemplateBinding FontStyle}" FontWeight="{TemplateBinding FontWeight}" Foreground="{TemplateBinding Foreground}" Grid.Column="0" Grid.Row="1" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" x:Name="ExpandSite" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" Visibility="Visible" Width="Auto" Height="Auto" RenderTransformOrigin="0.5,0.5"&gt;
                                                &lt;ContentControl.RenderTransform&gt;
                                                    &lt;TransformGroup&gt;
                                                        &lt;ScaleTransform x:Name="Scale"/&gt;
                                                        &lt;SkewTransform/&gt;
                                                        &lt;RotateTransform/&gt;
                                                        &lt;TranslateTransform/&gt;
                                                    &lt;/TransformGroup&gt;
                                                &lt;/ContentControl.RenderTransform&gt;
                                            &lt;/ContentControl&gt;
                                        &lt;/Grid&gt;
                                    &lt;/Border&gt;
                                    &lt;Border x:Name="DisabledVisualElement" IsHitTestVisible="false" Opacity="0" Background="#A5FFFFFF" CornerRadius="3"/&gt;
                                    &lt;Border x:Name="FocusVisualElement" IsHitTestVisible="false" Visibility="Collapsed" BorderThickness="1" CornerRadius="3"&gt;
                                        &lt;Border.BorderBrush&gt;
                                            &lt;LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"&gt;
                                                &lt;GradientStop Color="#FFA3AEB9"/&gt;
                                                &lt;GradientStop Color="#FF8399A9" Offset="0.375"/&gt;
                                                &lt;GradientStop Color="#FF718597" Offset="0.375"/&gt;
                                                &lt;GradientStop Color="#FF617584" Offset="1"/&gt;
                                            &lt;/LinearGradientBrush&gt;
                                        &lt;/Border.BorderBrush&gt;
                                    &lt;/Border&gt;
                                &lt;/Grid&gt;
                            &lt;/ControlTemplate&gt;
                        &lt;/Setter.Value&gt;
                    &lt;/Setter&gt;
                &lt;/Style&gt;
                &lt;Style x:Key="ExpanderNoButtonStyle" TargetType="toolkit:Expander"&gt;
                    &lt;Setter Property="Background" Value="Transparent"/&gt;
                    &lt;Setter Property="BorderBrush" Value="Transparent"/&gt;
                    &lt;Setter Property="BorderThickness" Value="1"/&gt;
                    &lt;Setter Property="HorizontalContentAlignment" Value="Stretch"/&gt;
                    &lt;Setter Property="VerticalContentAlignment" Value="Stretch"/&gt;
                    &lt;Setter Property="Template"&gt;
                        &lt;Setter.Value&gt;
                            &lt;ControlTemplate TargetType="toolkit:Expander"&gt;
                                &lt;Grid Background="Transparent"&gt;
                                    &lt;vsm:VisualStateManager.VisualStateGroups&gt;
                                        &lt;vsm:VisualStateGroup x:Name="CommonStates"&gt;
                                            &lt;vsm:VisualStateGroup.Transitions&gt;
                                                &lt;vsm:VisualTransition GeneratedDuration="0"/&gt;
                                            &lt;/vsm:VisualStateGroup.Transitions&gt;
                                            &lt;vsm:VisualState x:Name="Normal"/&gt;
                                            &lt;vsm:VisualState x:Name="Disabled"&gt;
                                                &lt;Storyboard&gt;
                                                    &lt;DoubleAnimation Duration="0" Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="(UIElement.Opacity)" To="1"/&gt;
                                                &lt;/Storyboard&gt;
                                            &lt;/vsm:VisualState&gt;
                                        &lt;/vsm:VisualStateGroup&gt;
                                        &lt;vsm:VisualStateGroup x:Name="FocusStates"&gt;
                                            &lt;vsm:VisualState x:Name="Focused"&gt;
                                                &lt;Storyboard&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                &lt;/Storyboard&gt;
                                            &lt;/vsm:VisualState&gt;
                                            &lt;vsm:VisualState x:Name="Unfocused"/&gt;
                                        &lt;/vsm:VisualStateGroup&gt;
                                        &lt;vsm:VisualStateGroup x:Name="ExpansionStates"&gt;
                                            &lt;vsm:VisualStateGroup.Transitions&gt;
                                                &lt;vsm:VisualTransition GeneratedDuration="0"/&gt;
                                            &lt;/vsm:VisualStateGroup.Transitions&gt;
                                            &lt;vsm:VisualState x:Name="Collapsed"/&gt;
                                            &lt;vsm:VisualState x:Name="Expanded"&gt;
                                                &lt;Storyboard&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="Visibility"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                &lt;/Storyboard&gt;
                                            &lt;/vsm:VisualState&gt;
                                        &lt;/vsm:VisualStateGroup&gt;
                                        &lt;vsm:VisualStateGroup x:Name="ExpandDirectionStates"&gt;
                                            &lt;vsm:VisualStateGroup.Transitions&gt;
                                                &lt;vsm:VisualTransition GeneratedDuration="0"/&gt;
                                            &lt;/vsm:VisualStateGroup.Transitions&gt;
                                            &lt;vsm:VisualState x:Name="ExpandDown"&gt;
                                                &lt;Storyboard&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="rd1" Storyboard.TargetProperty="Height"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="*"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="cd0" Storyboard.TargetProperty="Width"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="*"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                &lt;/Storyboard&gt;
                                            &lt;/vsm:VisualState&gt;
                                            &lt;vsm:VisualState x:Name="ExpandUp"&gt;
                                                &lt;Storyboard&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="(Grid.Row)"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="1"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(Grid.Row)"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="0"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="rd0" Storyboard.TargetProperty="Height"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="*"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="cd0" Storyboard.TargetProperty="Width"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="*"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                &lt;/Storyboard&gt;
                                            &lt;/vsm:VisualState&gt;
                                            &lt;vsm:VisualState x:Name="ExpandLeft"&gt;
                                                &lt;Storyboard&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="(Grid.Column)"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="1"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(Grid.Row)"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="0"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="rd0" Storyboard.TargetProperty="Height"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="*"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="cd0" Storyboard.TargetProperty="Width"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="*"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                &lt;/Storyboard&gt;
                                            &lt;/vsm:VisualState&gt;
                                            &lt;vsm:VisualState x:Name="ExpandRight"&gt;
                                                &lt;Storyboard&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(Grid.Row)"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="0"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(Grid.Column)"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="1"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="rd0" Storyboard.TargetProperty="Height"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="*"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="cd1" Storyboard.TargetProperty="Width"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="*"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                &lt;/Storyboard&gt;
                                            &lt;/vsm:VisualState&gt;
                                        &lt;/vsm:VisualStateGroup&gt;
                                    &lt;/vsm:VisualStateManager.VisualStateGroups&gt;
                                    &lt;Border x:Name="Background" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3"&gt;
                                        &lt;Grid&gt;
                                            &lt;Grid.RowDefinitions&gt;
                                                &lt;RowDefinition Height="Auto" x:Name="rd0"/&gt;
                                                &lt;RowDefinition Height="Auto" x:Name="rd1"/&gt;
                                            &lt;/Grid.RowDefinitions&gt;
                                            &lt;Grid.ColumnDefinitions&gt;
                                                &lt;ColumnDefinition Width="Auto" x:Name="cd0"/&gt;
                                                &lt;ColumnDefinition Width="Auto" x:Name="cd1"/&gt;
                                            &lt;/Grid.ColumnDefinitions&gt;
                                            &lt;ToggleButton Content="{TemplateBinding Header}" ContentTemplate="{TemplateBinding HeaderTemplate}" FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}" FontStretch="{TemplateBinding FontStretch}" FontStyle="{TemplateBinding FontStyle}" FontWeight="{TemplateBinding FontWeight}" Foreground="{TemplateBinding Foreground}" Grid.Column="0" Grid.Row="0" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" IsChecked="{TemplateBinding IsExpanded}" Margin="1" MinHeight="0" MinWidth="0" x:Name="ExpanderButton" Padding="{TemplateBinding Padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/&gt;
                                            &lt;ContentControl Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}" FontStretch="{TemplateBinding FontStretch}" FontStyle="{TemplateBinding FontStyle}" FontWeight="{TemplateBinding FontWeight}" Foreground="{TemplateBinding Foreground}" Grid.Column="0" Grid.Row="1" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" x:Name="ExpandSite" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" Visibility="Collapsed"/&gt;
                                        &lt;/Grid&gt;
                                    &lt;/Border&gt;
                                    &lt;Border x:Name="DisabledVisualElement" IsHitTestVisible="false" Opacity="0" Background="#A5FFFFFF" CornerRadius="3"/&gt;
                                    &lt;Border x:Name="FocusVisualElement" IsHitTestVisible="false" Visibility="Collapsed" BorderThickness="1" CornerRadius="3"&gt;
                                        &lt;Border.BorderBrush&gt;
                                            &lt;LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"&gt;
                                                &lt;GradientStop Color="#FFA3AEB9"/&gt;
                                                &lt;GradientStop Color="#FF8399A9" Offset="0.375"/&gt;
                                                &lt;GradientStop Color="#FF718597" Offset="0.375"/&gt;
                                                &lt;GradientStop Color="#FF617584" Offset="1"/&gt;
                                            &lt;/LinearGradientBrush&gt;
                                        &lt;/Border.BorderBrush&gt;
                                    &lt;/Border&gt;
                                &lt;/Grid&gt;
                            &lt;/ControlTemplate&gt;
                        &lt;/Setter.Value&gt;
                    &lt;/Setter&gt;
                &lt;/Style&gt;
                &lt;Style x:Key="ExpanderBottomRightButtonStyle" TargetType="toolkit:Expander"&gt;
                    &lt;Setter Property="Background" Value="Transparent"/&gt;
                    &lt;Setter Property="BorderBrush" Value="Transparent"/&gt;
                    &lt;Setter Property="BorderThickness" Value="1"/&gt;
                    &lt;Setter Property="HorizontalContentAlignment" Value="Stretch"/&gt;
                    &lt;Setter Property="VerticalContentAlignment" Value="Stretch"/&gt;
                    &lt;Setter Property="Template"&gt;
                        &lt;Setter.Value&gt;
                            &lt;ControlTemplate TargetType="toolkit:Expander"&gt;
                                &lt;Grid Background="Transparent"&gt;
                                    &lt;Grid.Resources&gt;
                                        &lt;LinearGradientBrush x:Key="ExpanderArrowFill" EndPoint="0,1" StartPoint="0,0"&gt;
                                            &lt;GradientStop Color="White" Offset="0"/&gt;
                                            &lt;GradientStop Color="#FFBFBFBF" Offset="0.5"/&gt;
                                            &lt;GradientStop Color="#FF878787" Offset="1"/&gt;
                                        &lt;/LinearGradientBrush&gt;
                                        &lt;LinearGradientBrush x:Key="ExpanderArrowHoverFill" EndPoint="0,1" StartPoint="0,0"&gt;
                                            &lt;GradientStop Color="#FFF0F8FE" Offset="0"/&gt;
                                            &lt;GradientStop Color="#FFE0F3FE" Offset="0.3"/&gt;
                                            &lt;GradientStop Color="#FF6FA7C5" Offset="1"/&gt;
                                        &lt;/LinearGradientBrush&gt;
                                        &lt;LinearGradientBrush x:Key="ExpanderArrowPressedFill" EndPoint="0,1" StartPoint="0,0"&gt;
                                            &lt;GradientStop Color="#FFDCF0FA" Offset="0"/&gt;
                                            &lt;GradientStop Color="#FFC5E6F7" Offset="0.2"/&gt;
                                            &lt;GradientStop Color="#FF5690D0" Offset="1"/&gt;
                                        &lt;/LinearGradientBrush&gt;
                                        &lt;ControlTemplate x:Key="ExpanderDownHeaderTemplate" TargetType="ToggleButton"&gt;
                                            &lt;Grid Background="Transparent"&gt;
                                                &lt;vsm:VisualStateManager.VisualStateGroups&gt;
                                                    &lt;vsm:VisualStateGroup x:Name="CheckStates"&gt;
                                                        &lt;vsm:VisualStateGroup.Transitions&gt;
                                                            &lt;vsm:VisualTransition GeneratedDuration="00:00:00"/&gt;
                                                        &lt;/vsm:VisualStateGroup.Transitions&gt;
                                                        &lt;vsm:VisualState x:Name="Checked"&gt;
                                                            &lt;Storyboard&gt;
                                                                &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="Data"&gt;
                                                                    &lt;DiscreteObjectKeyFrame KeyTime="0" Value="M 1,4.5 L 4.5,1 L 8,4.5"/&gt;
                                                                &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                            &lt;/Storyboard&gt;
                                                        &lt;/vsm:VisualState&gt;
                                                        &lt;vsm:VisualState x:Name="Unchecked"/&gt;
                                                    &lt;/vsm:VisualStateGroup&gt;
                                                    &lt;vsm:VisualStateGroup x:Name="CommonStates"&gt;
                                                        &lt;vsm:VisualStateGroup.Transitions&gt;
                                                            &lt;vsm:VisualTransition GeneratedDuration="0"/&gt;
                                                            &lt;vsm:VisualTransition GeneratedDuration="00:00:00.1" To="MouseOver"/&gt;
                                                            &lt;vsm:VisualTransition GeneratedDuration="00:00:00.1" To="Pressed"/&gt;
                                                        &lt;/vsm:VisualStateGroup.Transitions&gt;
                                                        &lt;vsm:VisualState x:Name="Normal"/&gt;
                                                        &lt;vsm:VisualState x:Name="MouseOver"&gt;
                                                            &lt;Storyboard&gt;
                                                                &lt;ColorAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Stroke).(SolidColorBrush.Color)" To="#FF3C7FB1"/&gt;
                                                                &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Fill)"&gt;
                                                                    &lt;DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderArrowHoverFill}"/&gt;
                                                                &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                                &lt;ColorAnimation BeginTime="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="(Path.Stroke).(SolidColorBrush.Color)" To="#222"/&gt;
                                                            &lt;/Storyboard&gt;
                                                        &lt;/vsm:VisualState&gt;
                                                        &lt;vsm:VisualState x:Name="Pressed"&gt;
                                                            &lt;Storyboard&gt;
                                                                &lt;ColorAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Stroke).(SolidColorBrush.Color)" To="#FF526C7B"/&gt;
                                                                &lt;DoubleAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="StrokeThickness" To="1.5"/&gt;
                                                                &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Fill)"&gt;
                                                                    &lt;DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderArrowPressedFill}"/&gt;
                                                                &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                                &lt;ColorAnimation BeginTime="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="(Path.Stroke).(SolidColorBrush.Color)" To="#FF003366"/&gt;
                                                            &lt;/Storyboard&gt;
                                                        &lt;/vsm:VisualState&gt;
                                                    &lt;/vsm:VisualStateGroup&gt;
                                                    &lt;vsm:VisualStateGroup x:Name="FocusStates"&gt;
                                                        &lt;vsm:VisualState x:Name="Focused"&gt;
                                                            &lt;Storyboard&gt;
                                                                &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility"&gt;
                                                                    &lt;DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/&gt;
                                                                &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                            &lt;/Storyboard&gt;
                                                        &lt;/vsm:VisualState&gt;
                                                        &lt;vsm:VisualState x:Name="Unfocused"/&gt;
                                                    &lt;/vsm:VisualStateGroup&gt;
                                                &lt;/vsm:VisualStateManager.VisualStateGroups&gt;
                                                &lt;Border Padding="{TemplateBinding Padding}"&gt;
                                                    &lt;Grid Background="Transparent"&gt;
                                                        &lt;Grid.ColumnDefinitions&gt;
                                                            &lt;ColumnDefinition Width="*"/&gt;
                                                            &lt;ColumnDefinition Width="19"/&gt;
                                                        &lt;/Grid.ColumnDefinitions&gt;
                                                        &lt;Grid Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Top"&gt;
                                                            &lt;Ellipse Fill="{StaticResource ExpanderArrowFill}" Height="19" HorizontalAlignment="Center" x:Name="circle" Stroke="DarkGray" VerticalAlignment="Center" Width="19"/&gt;
                                                            &lt;Path Data="M 1,1.5 L 4.5,5 L 8,1.5" HorizontalAlignment="Center" x:Name="arrow" Stroke="#666" StrokeThickness="2" VerticalAlignment="Center"/&gt;
                                                        &lt;/Grid&gt;
                                                        &lt;ContentPresenter Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" HorizontalAlignment="Left" Margin="4,0,0,0" x:Name="header" VerticalAlignment="Center"/&gt;
                                                    &lt;/Grid&gt;
                                                &lt;/Border&gt;
                                                &lt;Rectangle IsHitTestVisible="false" x:Name="FocusVisualElement" Stroke="Green" StrokeDashArray="1 2" StrokeThickness="1" Visibility="Collapsed"/&gt;
                                            &lt;/Grid&gt;
                                        &lt;/ControlTemplate&gt;
                                        &lt;ControlTemplate x:Key="ExpanderUpHeaderTemplate" TargetType="ToggleButton"&gt;
                                            &lt;Grid Background="Transparent"&gt;
                                                &lt;vsm:VisualStateManager.VisualStateGroups&gt;
                                                    &lt;vsm:VisualStateGroup x:Name="CheckStates"&gt;
                                                        &lt;vsm:VisualStateGroup.Transitions&gt;
                                                            &lt;vsm:VisualTransition GeneratedDuration="00:00:00"/&gt;
                                                        &lt;/vsm:VisualStateGroup.Transitions&gt;
                                                        &lt;vsm:VisualState x:Name="Checked"&gt;
                                                            &lt;Storyboard&gt;
                                                                &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="Data"&gt;
                                                                    &lt;DiscreteObjectKeyFrame KeyTime="0" Value="M 1,4.5 L 4.5,1 L 8,4.5"/&gt;
                                                                &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                            &lt;/Storyboard&gt;
                                                        &lt;/vsm:VisualState&gt;
                                                        &lt;vsm:VisualState x:Name="Unchecked"/&gt;
                                                    &lt;/vsm:VisualStateGroup&gt;
                                                    &lt;vsm:VisualStateGroup x:Name="CommonStates"&gt;
                                                        &lt;vsm:VisualStateGroup.Transitions&gt;
                                                            &lt;vsm:VisualTransition GeneratedDuration="0"/&gt;
                                                            &lt;vsm:VisualTransition GeneratedDuration="00:00:00.1" To="MouseOver"/&gt;
                                                            &lt;vsm:VisualTransition GeneratedDuration="00:00:00.1" To="Pressed"/&gt;
                                                        &lt;/vsm:VisualStateGroup.Transitions&gt;
                                                        &lt;vsm:VisualState x:Name="Normal"/&gt;
                                                        &lt;vsm:VisualState x:Name="MouseOver"&gt;
                                                            &lt;Storyboard&gt;
                                                                &lt;ColorAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Stroke).(SolidColorBrush.Color)" To="#FF3C7FB1"/&gt;
                                                                &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Fill)"&gt;
                                                                    &lt;DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderArrowHoverFill}"/&gt;
                                                                &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                                &lt;ColorAnimation BeginTime="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="(Path.Stroke).(SolidColorBrush.Color)" To="#222"/&gt;
                                                            &lt;/Storyboard&gt;
                                                        &lt;/vsm:VisualState&gt;
                                                        &lt;vsm:VisualState x:Name="Pressed"&gt;
                                                            &lt;Storyboard&gt;
                                                                &lt;ColorAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Stroke).(SolidColorBrush.Color)" To="#FF526C7B"/&gt;
                                                                &lt;DoubleAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="StrokeThickness" To="1.5"/&gt;
                                                                &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Fill)"&gt;
                                                                    &lt;DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderArrowPressedFill}"/&gt;
                                                                &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                                &lt;ColorAnimation BeginTime="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="(Path.Stroke).(SolidColorBrush.Color)" To="#FF003366"/&gt;
                                                            &lt;/Storyboard&gt;
                                                        &lt;/vsm:VisualState&gt;
                                                    &lt;/vsm:VisualStateGroup&gt;
                                                    &lt;vsm:VisualStateGroup x:Name="FocusStates"&gt;
                                                        &lt;vsm:VisualState x:Name="Focused"&gt;
                                                            &lt;Storyboard&gt;
                                                                &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility"&gt;
                                                                    &lt;DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/&gt;
                                                                &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                            &lt;/Storyboard&gt;
                                                        &lt;/vsm:VisualState&gt;
                                                        &lt;vsm:VisualState x:Name="Unfocused"/&gt;
                                                    &lt;/vsm:VisualStateGroup&gt;
                                                &lt;/vsm:VisualStateManager.VisualStateGroups&gt;
                                                &lt;Border Padding="{TemplateBinding Padding}"&gt;
                                                    &lt;Grid Background="Transparent"&gt;
                                                        &lt;Grid.ColumnDefinitions&gt;
                                                            &lt;ColumnDefinition Width="*"/&gt;
                                                            &lt;ColumnDefinition Width="19"/&gt;
                                                        &lt;/Grid.ColumnDefinitions&gt;
                                                        &lt;Grid Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Top"&gt;
                                                            &lt;Grid.RenderTransform&gt;
                                                                &lt;TransformGroup&gt;
                                                                    &lt;TransformGroup.Children&gt;
                                                                        &lt;TransformCollection&gt;
                                                                            &lt;RotateTransform Angle="180" CenterX="9.5" CenterY="9.5"/&gt;
                                                                        &lt;/TransformCollection&gt;
                                                                    &lt;/TransformGroup.Children&gt;
                                                                &lt;/TransformGroup&gt;
                                                            &lt;/Grid.RenderTransform&gt;
                                                            &lt;Ellipse Fill="{StaticResource ExpanderArrowFill}" Height="19" HorizontalAlignment="Center" x:Name="circle" Stroke="DarkGray" VerticalAlignment="Center" Width="19"/&gt;
                                                            &lt;Path Data="M 1,1.5 L 4.5,5 L 8,1.5" HorizontalAlignment="Center" x:Name="arrow" Stroke="#666" StrokeThickness="2" VerticalAlignment="Center"/&gt;
                                                        &lt;/Grid&gt;
                                                        &lt;ContentPresenter Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" HorizontalAlignment="Left" Margin="4,0,0,0" x:Name="header" VerticalAlignment="Center"/&gt;
                                                    &lt;/Grid&gt;
                                                &lt;/Border&gt;
                                                &lt;Rectangle IsHitTestVisible="false" x:Name="FocusVisualElement" Stroke="Green" StrokeDashArray="1 2" StrokeThickness="1" Visibility="Collapsed"/&gt;
                                            &lt;/Grid&gt;
                                        &lt;/ControlTemplate&gt;
                                        &lt;ControlTemplate x:Key="ExpanderLeftHeaderTemplate" TargetType="ToggleButton"&gt;
                                            &lt;Grid Background="Transparent"&gt;
                                                &lt;vsm:VisualStateManager.VisualStateGroups&gt;
                                                    &lt;vsm:VisualStateGroup x:Name="CheckStates"&gt;
                                                        &lt;vsm:VisualStateGroup.Transitions&gt;
                                                            &lt;vsm:VisualTransition GeneratedDuration="00:00:00"/&gt;
                                                        &lt;/vsm:VisualStateGroup.Transitions&gt;
                                                        &lt;vsm:VisualState x:Name="Checked"&gt;
                                                            &lt;Storyboard&gt;
                                                                &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="Data"&gt;
                                                                    &lt;DiscreteObjectKeyFrame KeyTime="0" Value="M 1,4.5 L 4.5,1 L 8,4.5"/&gt;
                                                                &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                            &lt;/Storyboard&gt;
                                                        &lt;/vsm:VisualState&gt;
                                                        &lt;vsm:VisualState x:Name="Unchecked"/&gt;
                                                    &lt;/vsm:VisualStateGroup&gt;
                                                    &lt;vsm:VisualStateGroup x:Name="CommonStates"&gt;
                                                        &lt;vsm:VisualStateGroup.Transitions&gt;
                                                            &lt;vsm:VisualTransition GeneratedDuration="0"/&gt;
                                                            &lt;vsm:VisualTransition GeneratedDuration="00:00:00.1" To="MouseOver"/&gt;
                                                            &lt;vsm:VisualTransition GeneratedDuration="00:00:00.1" To="Pressed"/&gt;
                                                        &lt;/vsm:VisualStateGroup.Transitions&gt;
                                                        &lt;vsm:VisualState x:Name="Normal"/&gt;
                                                        &lt;vsm:VisualState x:Name="MouseOver"&gt;
                                                            &lt;Storyboard&gt;
                                                                &lt;ColorAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Stroke).(SolidColorBrush.Color)" To="#FF3C7FB1"/&gt;
                                                                &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Fill)"&gt;
                                                                    &lt;DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderArrowHoverFill}"/&gt;
                                                                &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                                &lt;ColorAnimation BeginTime="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="(Path.Stroke).(SolidColorBrush.Color)" To="#222"/&gt;
                                                            &lt;/Storyboard&gt;
                                                        &lt;/vsm:VisualState&gt;
                                                        &lt;vsm:VisualState x:Name="Pressed"&gt;
                                                            &lt;Storyboard&gt;
                                                                &lt;ColorAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Stroke).(SolidColorBrush.Color)" To="#FF526C7B"/&gt;
                                                                &lt;DoubleAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="StrokeThickness" To="1.5"/&gt;
                                                                &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Fill)"&gt;
                                                                    &lt;DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderArrowPressedFill}"/&gt;
                                                                &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                                &lt;ColorAnimation BeginTime="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="(Path.Stroke).(SolidColorBrush.Color)" To="#FF003366"/&gt;
                                                            &lt;/Storyboard&gt;
                                                        &lt;/vsm:VisualState&gt;
                                                    &lt;/vsm:VisualStateGroup&gt;
                                                    &lt;vsm:VisualStateGroup x:Name="FocusStates"&gt;
                                                        &lt;vsm:VisualState x:Name="Focused"&gt;
                                                            &lt;Storyboard&gt;
                                                                &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility"&gt;
                                                                    &lt;DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/&gt;
                                                                &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                            &lt;/Storyboard&gt;
                                                        &lt;/vsm:VisualState&gt;
                                                        &lt;vsm:VisualState x:Name="Unfocused"/&gt;
                                                    &lt;/vsm:VisualStateGroup&gt;
                                                &lt;/vsm:VisualStateManager.VisualStateGroups&gt;
                                                &lt;Border Padding="{TemplateBinding Padding}"&gt;
                                                    &lt;Grid Background="Transparent"&gt;
                                                        &lt;Grid.RowDefinitions&gt;
                                                            &lt;RowDefinition Height="*"/&gt;
                                                            &lt;RowDefinition Height="19"/&gt;
                                                        &lt;/Grid.RowDefinitions&gt;
                                                        &lt;Grid Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Top"&gt;
                                                            &lt;Grid.RenderTransform&gt;
                                                                &lt;TransformGroup&gt;
                                                                    &lt;TransformGroup.Children&gt;
                                                                        &lt;TransformCollection&gt;
                                                                            &lt;RotateTransform Angle="90" CenterX="9.5" CenterY="9.5"/&gt;
                                                                        &lt;/TransformCollection&gt;
                                                                    &lt;/TransformGroup.Children&gt;
                                                                &lt;/TransformGroup&gt;
                                                            &lt;/Grid.RenderTransform&gt;
                                                            &lt;Ellipse Fill="{StaticResource ExpanderArrowFill}" Height="19" HorizontalAlignment="Center" x:Name="circle" Width="19" Stroke="DarkGray" VerticalAlignment="Center"/&gt;
                                                            &lt;Path Data="M 1,1.5 L 4.5,5 L 8,1.5" HorizontalAlignment="Center" x:Name="arrow" Stroke="#666" StrokeThickness="2" VerticalAlignment="Center"/&gt;
                                                        &lt;/Grid&gt;
                                                        &lt;ContentPresenter Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" HorizontalAlignment="Center" Margin="0,4,0,0" x:Name="header" VerticalAlignment="Top"/&gt;
                                                    &lt;/Grid&gt;
                                                &lt;/Border&gt;
                                                &lt;Rectangle IsHitTestVisible="false" x:Name="FocusVisualElement" Stroke="Green" StrokeDashArray="1 2" StrokeThickness="1" Visibility="Collapsed"/&gt;
                                            &lt;/Grid&gt;
                                        &lt;/ControlTemplate&gt;
                                        &lt;ControlTemplate x:Key="ExpanderRightHeaderTemplate" TargetType="ToggleButton"&gt;
                                            &lt;Grid Background="Transparent"&gt;
                                                &lt;vsm:VisualStateManager.VisualStateGroups&gt;
                                                    &lt;vsm:VisualStateGroup x:Name="CheckStates"&gt;
                                                        &lt;vsm:VisualStateGroup.Transitions&gt;
                                                            &lt;vsm:VisualTransition GeneratedDuration="00:00:00"/&gt;
                                                        &lt;/vsm:VisualStateGroup.Transitions&gt;
                                                        &lt;vsm:VisualState x:Name="Checked"&gt;
                                                            &lt;Storyboard&gt;
                                                                &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="Data"&gt;
                                                                    &lt;DiscreteObjectKeyFrame KeyTime="0" Value="M 1,4.5 L 4.5,1 L 8,4.5"/&gt;
                                                                &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                            &lt;/Storyboard&gt;
                                                        &lt;/vsm:VisualState&gt;
                                                        &lt;vsm:VisualState x:Name="Unchecked"/&gt;
                                                    &lt;/vsm:VisualStateGroup&gt;
                                                    &lt;vsm:VisualStateGroup x:Name="CommonStates"&gt;
                                                        &lt;vsm:VisualStateGroup.Transitions&gt;
                                                            &lt;vsm:VisualTransition GeneratedDuration="0"/&gt;
                                                            &lt;vsm:VisualTransition GeneratedDuration="00:00:00.1" To="MouseOver"/&gt;
                                                            &lt;vsm:VisualTransition GeneratedDuration="00:00:00.1" To="Pressed"/&gt;
                                                        &lt;/vsm:VisualStateGroup.Transitions&gt;
                                                        &lt;vsm:VisualState x:Name="Normal"/&gt;
                                                        &lt;vsm:VisualState x:Name="MouseOver"&gt;
                                                            &lt;Storyboard&gt;
                                                                &lt;ColorAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Stroke).(SolidColorBrush.Color)" To="#FF3C7FB1"/&gt;
                                                                &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Fill)"&gt;
                                                                    &lt;DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderArrowHoverFill}"/&gt;
                                                                &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                                &lt;ColorAnimation BeginTime="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="(Path.Stroke).(SolidColorBrush.Color)" To="#222"/&gt;
                                                            &lt;/Storyboard&gt;
                                                        &lt;/vsm:VisualState&gt;
                                                        &lt;vsm:VisualState x:Name="Pressed"&gt;
                                                            &lt;Storyboard&gt;
                                                                &lt;ColorAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Stroke).(SolidColorBrush.Color)" To="#FF526C7B"/&gt;
                                                                &lt;DoubleAnimation BeginTime="0" Storyboard.TargetName="circle" Storyboard.TargetProperty="StrokeThickness" To="1.5"/&gt;
                                                                &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="circle" Storyboard.TargetProperty="(Ellipse.Fill)"&gt;
                                                                    &lt;DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderArrowPressedFill}"/&gt;
                                                                &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                                &lt;ColorAnimation BeginTime="0" Storyboard.TargetName="arrow" Storyboard.TargetProperty="(Path.Stroke).(SolidColorBrush.Color)" To="#FF003366"/&gt;
                                                            &lt;/Storyboard&gt;
                                                        &lt;/vsm:VisualState&gt;
                                                    &lt;/vsm:VisualStateGroup&gt;
                                                    &lt;vsm:VisualStateGroup x:Name="FocusStates"&gt;
                                                        &lt;vsm:VisualState x:Name="Focused"&gt;
                                                            &lt;Storyboard&gt;
                                                                &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility"&gt;
                                                                    &lt;DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/&gt;
                                                                &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                            &lt;/Storyboard&gt;
                                                        &lt;/vsm:VisualState&gt;
                                                        &lt;vsm:VisualState x:Name="Unfocused"/&gt;
                                                    &lt;/vsm:VisualStateGroup&gt;
                                                &lt;/vsm:VisualStateManager.VisualStateGroups&gt;
                                                &lt;Border Padding="{TemplateBinding Padding}"&gt;
                                                    &lt;Grid Background="Transparent"&gt;
                                                        &lt;Grid.RowDefinitions&gt;
                                                            &lt;RowDefinition Height="*"/&gt;
                                                            &lt;RowDefinition Height="19"/&gt;
                                                        &lt;/Grid.RowDefinitions&gt;
                                                        &lt;Grid Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Top"&gt;
                                                            &lt;Grid.RenderTransform&gt;
                                                                &lt;TransformGroup&gt;
                                                                    &lt;TransformGroup.Children&gt;
                                                                        &lt;TransformCollection&gt;
                                                                            &lt;RotateTransform Angle="270" CenterX="9.5" CenterY="9.5"/&gt;
                                                                        &lt;/TransformCollection&gt;
                                                                    &lt;/TransformGroup.Children&gt;
                                                                &lt;/TransformGroup&gt;
                                                            &lt;/Grid.RenderTransform&gt;
                                                            &lt;Ellipse Fill="{StaticResource ExpanderArrowFill}" Height="19" HorizontalAlignment="Center" x:Name="circle" Stroke="DarkGray" VerticalAlignment="Center" Width="19"/&gt;
                                                            &lt;Path Data="M 1,1.5 L 4.5,5 L 8,1.5" HorizontalAlignment="Center" x:Name="arrow" Stroke="#666" StrokeThickness="2" VerticalAlignment="Center"/&gt;
                                                        &lt;/Grid&gt;
                                                        &lt;ContentPresenter Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" HorizontalAlignment="Center" Margin="0,4,0,0" x:Name="header" VerticalAlignment="Top"/&gt;
                                                    &lt;/Grid&gt;
                                                &lt;/Border&gt;
                                                &lt;Rectangle IsHitTestVisible="false" x:Name="FocusVisualElement" Stroke="Green" StrokeDashArray="1 2" StrokeThickness="1" Visibility="Collapsed"/&gt;
                                            &lt;/Grid&gt;
                                        &lt;/ControlTemplate&gt;
                                    &lt;/Grid.Resources&gt;
                                    &lt;vsm:VisualStateManager.VisualStateGroups&gt;
                                        &lt;vsm:VisualStateGroup x:Name="CommonStates"&gt;
                                            &lt;vsm:VisualStateGroup.Transitions&gt;
                                                &lt;vsm:VisualTransition GeneratedDuration="0"/&gt;
                                            &lt;/vsm:VisualStateGroup.Transitions&gt;
                                            &lt;vsm:VisualState x:Name="Normal"/&gt;
                                            &lt;vsm:VisualState x:Name="Disabled"&gt;
                                                &lt;Storyboard&gt;
                                                    &lt;DoubleAnimation Duration="0" Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="(UIElement.Opacity)" To="1"/&gt;
                                                &lt;/Storyboard&gt;
                                            &lt;/vsm:VisualState&gt;
                                        &lt;/vsm:VisualStateGroup&gt;
                                        &lt;vsm:VisualStateGroup x:Name="FocusStates"&gt;
                                            &lt;vsm:VisualState x:Name="Focused"&gt;
                                                &lt;Storyboard&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                &lt;/Storyboard&gt;
                                            &lt;/vsm:VisualState&gt;
                                            &lt;vsm:VisualState x:Name="Unfocused"/&gt;
                                        &lt;/vsm:VisualStateGroup&gt;
                                        &lt;vsm:VisualStateGroup x:Name="ExpansionStates"&gt;
                                            &lt;vsm:VisualStateGroup.Transitions&gt;
                                                &lt;vsm:VisualTransition GeneratedDuration="0"/&gt;
                                            &lt;/vsm:VisualStateGroup.Transitions&gt;
                                            &lt;vsm:VisualState x:Name="Collapsed"/&gt;
                                            &lt;vsm:VisualState x:Name="Expanded"&gt;
                                                &lt;Storyboard&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="Visibility"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                &lt;/Storyboard&gt;
                                            &lt;/vsm:VisualState&gt;
                                        &lt;/vsm:VisualStateGroup&gt;
                                        &lt;vsm:VisualStateGroup x:Name="ExpandDirectionStates"&gt;
                                            &lt;vsm:VisualStateGroup.Transitions&gt;
                                                &lt;vsm:VisualTransition GeneratedDuration="0"/&gt;
                                            &lt;/vsm:VisualStateGroup.Transitions&gt;
                                            &lt;vsm:VisualState x:Name="ExpandDown"&gt;
                                                &lt;Storyboard&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="rd1" Storyboard.TargetProperty="Height"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="*"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="cd0" Storyboard.TargetProperty="Width"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="*"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                &lt;/Storyboard&gt;
                                            &lt;/vsm:VisualState&gt;
                                            &lt;vsm:VisualState x:Name="ExpandUp"&gt;
                                                &lt;Storyboard&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="Template"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderUpHeaderTemplate}"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="(Grid.Row)"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="1"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(Grid.Row)"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="0"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="rd0" Storyboard.TargetProperty="Height"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="*"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="cd0" Storyboard.TargetProperty="Width"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="*"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                &lt;/Storyboard&gt;
                                            &lt;/vsm:VisualState&gt;
                                            &lt;vsm:VisualState x:Name="ExpandLeft"&gt;
                                                &lt;Storyboard&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="Template"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderLeftHeaderTemplate}"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="(Grid.Column)"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="1"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(Grid.Row)"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="0"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="rd0" Storyboard.TargetProperty="Height"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="*"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="cd0" Storyboard.TargetProperty="Width"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="*"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                &lt;/Storyboard&gt;
                                            &lt;/vsm:VisualState&gt;
                                            &lt;vsm:VisualState x:Name="ExpandRight"&gt;
                                                &lt;Storyboard&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="Template"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="00:00:00.1000000" Value="{StaticResource ExpanderLeftHeaderTemplate}"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(Grid.Row)"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="0"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(Grid.Column)"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="1"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="rd0" Storyboard.TargetProperty="Height"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="*"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                    &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="cd1" Storyboard.TargetProperty="Width"&gt;
                                                        &lt;DiscreteObjectKeyFrame KeyTime="0" Value="*"/&gt;
                                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                &lt;/Storyboard&gt;
                                            &lt;/vsm:VisualState&gt;
                                        &lt;/vsm:VisualStateGroup&gt;
                                    &lt;/vsm:VisualStateManager.VisualStateGroups&gt;
                                    &lt;Border x:Name="Background" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3"&gt;
                                        &lt;Grid&gt;
                                            &lt;Grid.RowDefinitions&gt;
                                                &lt;RowDefinition Height="Auto" x:Name="rd0"/&gt;
                                                &lt;RowDefinition Height="Auto" x:Name="rd1"/&gt;
                                            &lt;/Grid.RowDefinitions&gt;
                                            &lt;Grid.ColumnDefinitions&gt;
                                                &lt;ColumnDefinition Width="Auto" x:Name="cd0"/&gt;
                                                &lt;ColumnDefinition Width="Auto" x:Name="cd1"/&gt;
                                            &lt;/Grid.ColumnDefinitions&gt;
                                            &lt;ToggleButton Content="{TemplateBinding Header}" ContentTemplate="{TemplateBinding HeaderTemplate}" FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}" FontStretch="{TemplateBinding FontStretch}" FontStyle="{TemplateBinding FontStyle}" FontWeight="{TemplateBinding FontWeight}" Foreground="{TemplateBinding Foreground}" Grid.Column="0" Grid.Row="0" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" IsChecked="{TemplateBinding IsExpanded}" Margin="1" MinHeight="0" MinWidth="0" x:Name="ExpanderButton" Padding="{TemplateBinding Padding}" Template="{StaticResource ExpanderDownHeaderTemplate}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/&gt;
                                            &lt;ContentControl Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}" FontStretch="{TemplateBinding FontStretch}" FontStyle="{TemplateBinding FontStyle}" FontWeight="{TemplateBinding FontWeight}" Foreground="{TemplateBinding Foreground}" Grid.Column="0" Grid.Row="1" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" x:Name="ExpandSite" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" Visibility="Collapsed"/&gt;
                                        &lt;/Grid&gt;
                                    &lt;/Border&gt;
                                    &lt;Border x:Name="DisabledVisualElement" IsHitTestVisible="false" Opacity="0" Background="#A5FFFFFF" CornerRadius="3"/&gt;
                                    &lt;Border x:Name="FocusVisualElement" IsHitTestVisible="false" Visibility="Collapsed" BorderThickness="1" CornerRadius="3"&gt;
                                        &lt;Border.BorderBrush&gt;
                                            &lt;LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"&gt;
                                                &lt;GradientStop Color="#FFA3AEB9"/&gt;
                                                &lt;GradientStop Color="#FF8399A9" Offset="0.375"/&gt;
                                                &lt;GradientStop Color="#FF718597" Offset="0.375"/&gt;
                                                &lt;GradientStop Color="#FF617584" Offset="1"/&gt;
                                            &lt;/LinearGradientBrush&gt;
                                        &lt;/Border.BorderBrush&gt;
                                    &lt;/Border&gt;
                                &lt;/Grid&gt;
                            &lt;/ControlTemplate&gt;
                        &lt;/Setter.Value&gt;
                    &lt;/Setter&gt;
                &lt;/Style&gt;
            &lt;/Grid.Resources&gt;
            &lt;Grid.RowDefinitions&gt;
                &lt;RowDefinition Height="Auto" /&gt;
                &lt;RowDefinition Height="150" /&gt;
            &lt;/Grid.RowDefinitions&gt;
            &lt;Grid.ColumnDefinitions&gt;
                &lt;ColumnDefinition Width="150" /&gt;
                &lt;ColumnDefinition Width="150" /&gt;
                &lt;ColumnDefinition Width="150" /&gt;
                &lt;ColumnDefinition Width="150" /&gt;
                &lt;ColumnDefinition Width="150" /&gt;
            &lt;/Grid.ColumnDefinitions&gt;

            &lt;TextBlock Grid.Row="0" Grid.Column="0" Style="{StaticResource Description}" Text="ExpandDirection"/&gt;
            &lt;TextBlock Grid.Row="0" Grid.Column="1" Style="{StaticResource Description}" Text="No Button"/&gt;
            &lt;TextBlock Grid.Row="0" Grid.Column="2" Style="{StaticResource Description}" Text="Button Right/Bottom" /&gt;
            &lt;TextBlock Grid.Row="0" Grid.Column="3" Style="{StaticResource Description}" Text="Fade In/Out"/&gt;
            &lt;TextBlock Grid.Row="0" Grid.Column="4" Style="{StaticResource Description}" Text="Scale In/Out" /&gt;

            &lt;ListBox x:Name="lbCustDirection" Grid.Row="1" Grid.Column="0" HorizontalAlignment="Left"&gt;
                &lt;ListBoxItem Content="Down" IsSelected="True"/&gt;
                &lt;ListBoxItem Content="Up" /&gt;
                &lt;ListBoxItem Content="Left" /&gt;
                &lt;ListBoxItem Content="Right" /&gt;
            &lt;/ListBox&gt;
            &lt;toolkit:Expander x:Name="expNoButton" Content="Content" Header="Header" 
                               Grid.Row="1" Grid.Column="1" Margin="5" Style="{StaticResource ExpanderNoButtonStyle}"&gt;
            &lt;/toolkit:Expander&gt;
            &lt;toolkit:Expander x:Name="expBRButton" Grid.Row="1" Grid.Column="2" Margin="5" Style="{StaticResource ExpanderBottomRightButtonStyle}"&gt;
                &lt;toolkit:Expander.Content&gt;
                    &lt;Button Content="&amp;lt;Button&amp;gt;"&gt;&lt;/Button&gt;
                &lt;/toolkit:Expander.Content&gt;
            &lt;/toolkit:Expander&gt;
            &lt;toolkit:Expander x:Name="expFade" Content="Content" Header="&amp;lt;HeaderTemplate&amp;gt;" 
                               Grid.Row="1" Grid.Column="3" Margin="5" Style="{StaticResource ExpanderFadeStyle}"&gt;
                &lt;toolkit:Expander.HeaderTemplate&gt;
                    &lt;DataTemplate&gt;
                        &lt;Button Content="{Binding}" Style="{StaticResource DemoButton}"&gt;&lt;/Button&gt;
                    &lt;/DataTemplate&gt;
                &lt;/toolkit:Expander.HeaderTemplate&gt;
            &lt;/toolkit:Expander&gt;
            &lt;toolkit:Expander x:Name="expScale" Header="&amp;lt;HeaderTemplate&amp;gt;" Content="&amp;lt;ContentTemplate&amp;gt;"
                               Grid.Row="1" Grid.Column="4" Margin="5" Style="{StaticResource ExpanderScaleStyle}"&gt;
                &lt;toolkit:Expander.HeaderTemplate&gt;
                    &lt;DataTemplate&gt;
                        &lt;TextBlock Text="{Binding}" Foreground="Blue"/&gt;
                    &lt;/DataTemplate&gt;
                &lt;/toolkit:Expander.HeaderTemplate&gt;
                &lt;toolkit:Expander.ContentTemplate&gt;
                    &lt;DataTemplate&gt;
                        &lt;Button Content="{Binding}" Style="{StaticResource DemoButton}"&gt;&lt;/Button&gt;
                    &lt;/DataTemplate&gt;
                &lt;/toolkit:Expander.ContentTemplate&gt;
            &lt;/toolkit:Expander&gt;
        &lt;/Grid&gt;
        
        &lt;!-- Interactive Usage --&gt;
        &lt;ContentControl Content="Interactive Usage" Style="{StaticResource Header}" /&gt;
        &lt;Grid&gt;
            &lt;Grid.ColumnDefinitions&gt;
                &lt;ColumnDefinition Width="200" /&gt;
                &lt;ColumnDefinition Width="10" /&gt;
                &lt;ColumnDefinition Width="*" /&gt;
            &lt;/Grid.ColumnDefinitions&gt;
            &lt;Grid&gt;
                &lt;StackPanel&gt;
                    &lt;Button Content="Button1"/&gt;
                    &lt;toolkit:Expander x:Name="expander" Style="{StaticResource DemoExpander}"/&gt;
                    &lt;Button Content="Button2"/&gt;
                    &lt;TextBlock x:Name="output" /&gt;
                &lt;/StackPanel&gt;
            &lt;/Grid&gt;
            &lt;Grid Grid.Column="2"&gt;
                &lt;Grid.ColumnDefinitions&gt;
                    &lt;ColumnDefinition Width="100" /&gt;
                    &lt;ColumnDefinition Width="5" /&gt;
                    &lt;ColumnDefinition Width="*" /&gt;
                &lt;/Grid.ColumnDefinitions&gt;
                &lt;Grid.RowDefinitions&gt;
                    &lt;RowDefinition Height="Auto" /&gt;
                    &lt;RowDefinition Height="Auto" /&gt;
                    &lt;RowDefinition Height="Auto" /&gt;
                    &lt;RowDefinition Height="Auto" /&gt;
                    &lt;RowDefinition Height="Auto" /&gt;
                    &lt;RowDefinition Height="Auto" /&gt;
                    &lt;RowDefinition Height="Auto" /&gt;
                    &lt;RowDefinition Height="*" /&gt;
                &lt;/Grid.RowDefinitions&gt;
                
                &lt;TextBlock Text="ExpandDirection:" Grid.Row="0" Grid.Column="0" /&gt;
                &lt;ListBox x:Name="lbExpandDirection" Grid.Row="0" Grid.Column="2" HorizontalAlignment="Left"&gt;
                    &lt;ListBoxItem Content="Down" IsSelected="True"/&gt;
                    &lt;ListBoxItem Content="Up" /&gt;
                    &lt;ListBoxItem Content="Left" /&gt;
                    &lt;ListBoxItem Content="Right" /&gt;
                &lt;/ListBox&gt;
                
                &lt;TextBlock Text="Header:" Grid.Row="1" Grid.Column="0" /&gt;
                &lt;TextBox x:Name="tbHeader" Grid.Row="1" Grid.Column="2" /&gt;
                
                &lt;TextBlock Text="HeaderTemplate:" Grid.Row="2" Grid.Column="0" /&gt;
                &lt;TextBox x:Name="tbHeaderTemplate" Grid.Row="2" Grid.Column="2" /&gt;
                
                &lt;TextBlock Text="Content:" Grid.Row="3" Grid.Column="0" /&gt;
                &lt;TextBox x:Name="tbContent" Grid.Row="3" Grid.Column="2" /&gt;
                
                &lt;TextBlock Text="ContentTemplate:" Grid.Row="4" Grid.Column="0" /&gt;
                &lt;TextBox x:Name="tbContentTemplate" Grid.Row="4" Grid.Column="2" /&gt;

                &lt;CheckBox x:Name="cbIsEnabled" Grid.Row="5" Grid.Column="2"
                          HorizontalAlignment="Left" Content="IsEnabled" IsChecked="true" /&gt;

                &lt;Button x:Name="btnChange" Grid.Row="6" Grid.Column="2"
                        HorizontalAlignment="Left" Content="Change!"/&gt;
            &lt;/Grid&gt;
        &lt;/Grid&gt;
    &lt;/StackPanel&gt;
&lt;/UserControl&gt;</sys:String>
    </src:SourceFile.Source>
  </src:SourceFile>
  <src:SourceFile Path="ExpanderSample.xaml.cs">
    <src:SourceFile.Source>
      <sys:String>// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Public License (Ms-PL).
// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
// All other rights reserved.

using System;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Markup;
using System.Windows.Media;
using System.ComponentModel;

namespace System.Windows.Controls.Samples
{
    /// &lt;summary&gt;
    /// Sample page demonstrating the Expander.
    /// &lt;/summary&gt;
    [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Expander", Justification = "Name of the control")]
    [Sample("Expander", DifficultyLevel.Basic)]
    [Category("Expander")]
    public partial class ExpanderSample : UserControl
    {
        /// &lt;summary&gt;
        /// Initializes a new instance of the ExpanderSample class.
        /// &lt;/summary&gt;
        public ExpanderSample()
        {
            InitializeComponent();
            Loaded += OnLoaded;
        }

        /// &lt;summary&gt;
        /// Load the demo page.
        /// &lt;/summary&gt;
        /// &lt;param name="sender"&gt;Sample page.&lt;/param&gt;
        /// &lt;param name="e"&gt;Event arguments.&lt;/param&gt;
        private void OnLoaded(object sender, RoutedEventArgs e)
        {
            // initalize customization area
            lbCustDirection.SelectionChanged += (x, y) =&gt;
                {
                    ExpandDirection d = (ExpandDirection)lbCustDirection.SelectedIndex;
                    expNoButton.ExpandDirection = d;
                    expBRButton.ExpandDirection = d;
                    expFade.ExpandDirection = d;
                    expScale.ExpandDirection = d;
                };

            // initialize interactive usage area
            btnChange.Click += ChangeSettings;

            tbHeader.Text = "Header";
            tbHeaderTemplate.Text = @"&lt;DataTemplate&gt;&lt;StackPanel Orientation=""Horizontal""&gt;&lt;Ellipse Width=""10"" Height=""10"" Fill=""Red""/&gt;&lt;Button Content=""{Binding}""/&gt;&lt;Ellipse Width=""10"" Height=""10"" Fill=""Red""/&gt;&lt;/StackPanel&gt;&lt;/DataTemplate&gt;";
            tbContent.Text = "Content";
            tbContentTemplate.Text = @"&lt;DataTemplate&gt;&lt;Button Content=""{Binding}""/&gt;&lt;/DataTemplate&gt;";

            expander.Expanded += (x, y) =&gt; OutputExpander();
            expander.Collapsed += (x, y) =&gt; OutputExpander();
        }

        /// &lt;summary&gt;
        /// Change ContentControl settings (Header, HeaderTemplate, Content, ContentTemplate).
        /// &lt;/summary&gt;
        /// &lt;param name="sender"&gt;Sender Button.&lt;/param&gt;
        /// &lt;param name="e"&gt;Event args.&lt;/param&gt;
        private void ChangeSettings(object sender, RoutedEventArgs e)
        {
            expander.ExpandDirection = (ExpandDirection) lbExpandDirection.SelectedIndex;
            expander.Header = tbHeader.Text;
            expander.Content = tbContent.Text;
            expander.IsEnabled = cbIsEnabled.IsChecked ?? true;

            if (String.IsNullOrEmpty(tbHeaderTemplate.Text))
            {
                expander.ClearValue(HeaderedContentControl.HeaderTemplateProperty);
            }
            else
            {
                try
                {
                    expander.HeaderTemplate = (DataTemplate) XamlReader.Load(AddXmlNS(tbHeaderTemplate.Text));
                    tbHeaderTemplate.Foreground = new SolidColorBrush(Colors.Black);
                }
                catch (XamlParseException)
                {
                    tbHeaderTemplate.Foreground = new SolidColorBrush(Colors.Red);
                }
            }

            if (string.IsNullOrEmpty(tbContentTemplate.Text))
            {
                expander.ClearValue(HeaderedContentControl.ContentTemplateProperty);
            }
            else
            {
                try
                {
                    expander.ContentTemplate = (DataTemplate) XamlReader.Load(AddXmlNS(tbContentTemplate.Text));
                    tbContentTemplate.Foreground = new SolidColorBrush(Colors.Black);
                }
                catch (XamlParseException)
                {
                    tbContentTemplate.Foreground = new SolidColorBrush(Colors.Red);
                }
            }

            OutputExpander();
        }

        /// &lt;summary&gt;
        /// Utility function to add xmlns to user inputed template string.
        /// &lt;/summary&gt;
        /// &lt;param name="s"&gt;User input template string.&lt;/param&gt;
        /// &lt;returns&gt;Well formated xaml with xmlns added.&lt;/returns&gt;
        private static string AddXmlNS(string s)
        {
            string xmlns = @" xmlns=""http://schemas.microsoft.com/client/2007""
                              xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml""
                              xmlns:controls=""clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.InternalOnly"" ";
            int i = s.IndexOf("&gt;", StringComparison.Ordinal);
            return (i == -1) ? "&gt;/" : s.Substring(0, i) + xmlns + s.Substring(i);
        }

        /// &lt;summary&gt;
        /// Display the interactive Expander control's properties.
        /// &lt;/summary&gt;
        private void OutputExpander()
        {
            string formatString = "\n\n" +
                " ExpandDirection:\t{0}\n" +
                " Header:\t{1}\n" +
                " Content:\t{2}\n" +
                " IsExpanded:\t{3}\n" +
                " IsEnabled:\t{4}\n";

            output.Text = string.Format(
                CultureInfo.InvariantCulture,
                formatString,
                expander.ExpandDirection,
                expander.Header,
                expander.Content,
                expander.IsExpanded,
                expander.IsEnabled);
        }
    }
}</sys:String>
    </src:SourceFile.Source>
  </src:SourceFile>
  <src:SourceFile Path="ExpanderSample.xaml.vb">
    <src:SourceFile.Source>
      <sys:String>' (c) Copyright Microsoft Corporation.
' This source is subject to the Microsoft Public License (Ms-PL).
' Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
' All other rights reserved.

Imports Microsoft.VisualBasic
Imports System
Imports System.Diagnostics.CodeAnalysis
Imports System.Globalization
Imports System.Windows
Imports System.Windows.Controls
Imports System.Windows.Markup
Imports System.Windows.Media
Imports System.ComponentModel

''' &lt;summary&gt;
''' Sample page demonstrating the Expander.
''' &lt;/summary&gt;
&lt;SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId:="Expander", Justification:="Name of the control"), Sample("Expander", DifficultyLevel.Basic), Category("Expander")&gt; _
Partial Public Class ExpanderSample
    Inherits UserControl
    ''' &lt;summary&gt;
    ''' Initializes a new instance of the ExpanderSample class.
    ''' &lt;/summary&gt;
    Public Sub New()
        InitializeComponent()
    End Sub

    ''' &lt;summary&gt;
    ''' Load the demo page.
    ''' &lt;/summary&gt;
    ''' &lt;param name="sender"&gt;Sample page.&lt;/param&gt;
    ''' &lt;param name="e"&gt;Event arguments.&lt;/param&gt;
    Private Sub OnLoaded(ByVal sender As Object, ByVal e As RoutedEventArgs) Handles Me.Loaded
        tbHeader.Text = "Header"
        tbHeaderTemplate.Text = "&lt;DataTemplate&gt;&lt;StackPanel Orientation=""Horizontal""&gt;&lt;Ellipse Width=""10"" Height=""10"" Fill=""Red""/&gt;&lt;Button Content=""{Binding}""/&gt;&lt;Ellipse Width=""10"" Height=""10"" Fill=""Red""/&gt;&lt;/StackPanel&gt;&lt;/DataTemplate&gt;"
        tbContent.Text = "Content"
        tbContentTemplate.Text = "&lt;DataTemplate&gt;&lt;Button Content=""{Binding}""/&gt;&lt;/DataTemplate&gt;"
    End Sub

    ''' &lt;summary&gt;
    ''' Change customization area expansion behavior.
    ''' &lt;/summary&gt;
    ''' &lt;param name="sender"&gt;Sender Button.&lt;/param&gt;
    ''' &lt;param name="e"&gt;Event args.&lt;/param&gt;
    Private Sub lbCustDirection_SelectionChanged(ByVal x As Object, ByVal y As Object) Handles lbCustDirection.SelectionChanged
        Dim d As ExpandDirection = CType(lbCustDirection.SelectedIndex, ExpandDirection)
        expNoButton.ExpandDirection = d
        expBRButton.ExpandDirection = d
        expFade.ExpandDirection = d
        expScale.ExpandDirection = d
    End Sub

    ''' &lt;summary&gt;
    ''' Change ContentControl settings (Header, HeaderTemplate, Content, ContentTemplate).
    ''' &lt;/summary&gt;
    ''' &lt;param name="sender"&gt;Sender Button.&lt;/param&gt;
    ''' &lt;param name="e"&gt;Event args.&lt;/param&gt;
    Private Sub ChangeSettings(ByVal sender As Object, ByVal e As RoutedEventArgs) Handles btnChange.Click
        expander.ExpandDirection = CType(lbExpandDirection.SelectedIndex, ExpandDirection)
        expander.Header = tbHeader.Text
        expander.Content = tbContent.Text
        expander.IsEnabled = If(cbIsEnabled.IsChecked.HasValue, cbIsEnabled.IsChecked.Value, True)

        If String.IsNullOrEmpty(tbHeaderTemplate.Text) Then
            expander.ClearValue(HeaderedContentControl.HeaderTemplateProperty)
        Else
            Try
                expander.HeaderTemplate = CType(XamlReader.Load(AddXmlNS(tbHeaderTemplate.Text)), DataTemplate)
                tbHeaderTemplate.Foreground = New SolidColorBrush(Colors.Black)
            Catch e1 As XamlParseException
                tbHeaderTemplate.Foreground = New SolidColorBrush(Colors.Red)
            End Try
        End If

        If String.IsNullOrEmpty(tbContentTemplate.Text) Then
            expander.ClearValue(HeaderedContentControl.ContentTemplateProperty)
        Else
            Try
                expander.ContentTemplate = CType(XamlReader.Load(AddXmlNS(tbContentTemplate.Text)), DataTemplate)
                tbContentTemplate.Foreground = New SolidColorBrush(Colors.Black)
            Catch e2 As XamlParseException
                tbContentTemplate.Foreground = New SolidColorBrush(Colors.Red)
            End Try
        End If

        OutputExpander(sender, e)
    End Sub

    ''' &lt;summary&gt;
    ''' Utility function to add xmlns to user inputed template string.
    ''' &lt;/summary&gt;
    ''' &lt;param name="s"&gt;User input template string.&lt;/param&gt;
    ''' &lt;returns&gt;Well formated xaml with xmlns added.&lt;/returns&gt;
    Private Shared Function AddXmlNS(ByVal s As String) As String
        Dim xmlns As String = " xmlns=""http://schemas.microsoft.com/client/2007""" &amp; ControlChars.CrLf &amp; _
        "                              xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml""" &amp; ControlChars.CrLf &amp; _
        "                              xmlns:controls=""clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.InternalOnly"" "
        Dim i As Integer = s.IndexOf("&gt;", StringComparison.Ordinal)
        Return If((i = -1), "&gt;/", s.Substring(0, i) &amp; xmlns &amp; s.Substring(i))
    End Function

    ''' &lt;summary&gt;
    ''' Display the interactive Expander control's properties.
    ''' &lt;/summary&gt;
    Private Sub OutputExpander(ByVal sender As Object, ByVal e As RoutedEventArgs) Handles expander.Expanded, expander.Collapsed
        Dim formatString As String = Constants.vbLf + Constants.vbLf &amp; _
            " ExpandDirection:" &amp; Constants.vbTab &amp; "{0}" &amp; Constants.vbLf &amp; _
            " Header:" &amp; Constants.vbTab &amp; "{1}" &amp; Constants.vbLf &amp; _
            " Content:" &amp; Constants.vbTab &amp; "{2}" &amp; Constants.vbLf &amp; _
            " IsExpanded:" &amp; Constants.vbTab &amp; "{3}" &amp; Constants.vbLf &amp; _
            " IsEnabled:" &amp; Constants.vbTab &amp; "{4}" &amp; Constants.vbLf

        output.Text = String.Format( _
            CultureInfo.InvariantCulture, _
            formatString, _
            expander.ExpandDirection, _
            expander.Header, _
            expander.Content, _
            expander.IsExpanded, _
            expander.IsEnabled)
    End Sub
End Class</sys:String>
    </src:SourceFile.Source>
  </src:SourceFile>
</src:SourceViewer>
    </StackPanel>
</UserControl>